From the jquery UI you can now apply .button() to an anchor, a button, a submit button etc.
I’ve got a simple asp.net button that looks like this:
<asp:Button ID="btnFindSearch" runat="server" Text="Search"
onclick="btnFindSearch_Click" />
It is however inside of an updatepanel like so:
<div id="dialog" title="Select Address">
<asp:UpdatePanel ID="upNewUpdatePanel" UpdateMode="Conditional" ChildrenAsTriggers="true" runat="server">
<ContentTemplate>
<div id="search" style="width:100%; text-align:center;">
<asp:TextBox ID="txtFindSearch" runat="server"></asp:TextBox>
<asp:Button ID="btnFindSearch" runat="server" Text="Search"
onclick="btnFindSearch_Click" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
In my jquery I can do:
$('#btnFindSearch').button();
And it gives me the jquery ui look of a button…awesome I thought. But the minute I click my button the button returns to the plain old looking asp.net server button. Its as if the .button() is no longer applied.
Is this due to the fact that it is inside an UpdatePanel or what could be causing this???
This can be done with the jQuery livequery plugin.
It can be used to define a function for all the elements what are currently in the dom and those which wud be added later.. that would solve most of your problems.
Here is an example usage: