我如何将jQueryUI样式应用于asp:Button。这是问题所在:jqueryUI按钮要求您使用以下格式<button>Test button</button>

当我尝试使用ASP按钮服务器控件<asp:Button />时,asp:Button呈现为<input type=button>Test button </input>

更新:我得到了jquery提供的标准按钮样式。但是,当我想用​​它制作工具栏时,例如下面的示例:http://jqueryui.com/demos/button/#toolbar,标准的asp:Button使我失败....或者也许我缺少了一些东西。
提前致谢,

Sashidhar Kokku

最佳答案

这就是您的操作方式:将以下内容添加到您的Initialize函数中:

$(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" }
   });

关于asp.net - 如何将jQuery UI按钮应用于asp:Button,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/2672001/

10-13 08:13
查看更多