如何申请jQuery UI的按钮到ASP:按钮 [英] How to apply jquery UI buttons to asp:Button
问题描述
我如何申请jQueryUI的风格,以一个asp:按钮。这里的问题是:jQueryUI的按钮,需要你有以下格式<按钮和GT;测试按钮< /按钮>
How do I apply jQueryUI styles to an asp:Button. Here is the problem: jqueryUI button requires you to have the following format <button>Test button</button>
当我尝试使用一个asp按钮服务器控件,&LT; ASP:按钮/&GT;
,ASP:按钮呈现为&LT;输入类型=按钮&GT;测试按钮&LT; /输入&GT;
When I try to use an asp button server control, <asp:Button />
, asp:Button renders as <input type=button>Test button </input>
更新:我得到的标准按钮样式的jQuery提供。然而,当我想打一个工具栏出来,就像这个例子:的http:// jQueryUI的。 COM /演示/按键/#栏,标准的asp:按钮出现故障,我....或者也许我失去了一些东西。
由于提前,
Update : I get the standard button styling that jquery provides. However, when I want to make a toolbar out of it, like in this example : http://jqueryui.com/demos/button/#toolbar, the standard asp:Button fails me....or maybe i am missing something. Thanks in advance,
Sashidhar Kokku
Sashidhar Kokku
推荐答案
这是你怎么做:将以下内容添加到您的初始化函数:
This is how you do it: Add the following to your initialize function:
$(function () {
//Converting asp buttons to html buttons
$('input:submit, input:reset').each(function () {
$(this).replaceWith('<button type="submit" name="' + $(this).attr('name') + '" class="' + $(this).attr('class') + '" id="' + $(this).attr('id') + '" >' + $(this).val() + '</button>');
});
//Adding button icons .....
$(".createbutton").button({
icons: { primary: "ui-icon-circle-plus" }
});
这篇关于如何申请jQuery UI的按钮到ASP:按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!