c# - jQuery UI class dissapears on button even though .button() is set in codebehind? -
im starting pull hair on this.
im trying append jquery ui's button appearance on regular button, doesn't appended. doesnt class..
<asp:updatepanel id="cartupdpanel" updatemode="conditional" childrenastriggers="true" runat="server"> <button runat="server" id="checkoutcartbutton" causesvalidation="false" enableviewstate="false">checkout</button> <triggers> <asp:postbacktrigger controlid="checkoutcartbutton" /> </triggers> </asp:updatepanel>
i want button have secondary icon. know how make happen. i'm running problems..
this checkout button cart (i had disabling working fine before wanted make fancy), , in code behind checks if have enough credit checkout or not, enabling/disabling button.
i cant create button in in ascx file because over-write disabling of button, making enabled:
scriptmanager.registerclientscriptblock(page, page.gettype(), "disable button", "console.log('disabled'); $('#" + checkoutcartbutton.clientid + "').button({ icons: { secondary: 'ui-icon-circle-arrow-e' }, disabled: true });", true);
i've tried using updatepanel's id control, no further success. , while writing thought page-life cycle problem, since cart credit being checked oninit. though changed pageload, no difference.
any wise people out there see problem?
you're attaching wrong method.
instead of scriptmanager.registerclientscriptblock
, use scriptmanager.registerstartupscript
.
also, enclose script $(function () { })
executed when page loaded.
should solve problem.
Comments
Post a Comment