Click here to Skip to main content
15,936,119 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a custom jquery css applied to from buttons but it looses its styling on partial page postback. After investigating I foundout that IE is removing css classes on partial postback.

ASP.NET
<asp:Button ID="btnSerach" CssClass="button" runat="server" Text="Find Customer" OnClientClick= " return open_search_box()" />


When the page renders it first time in IE it looks like

HTML
<input name="ctl00$JobLogPageContentPlaceHolder$btnSerach" class="button ui-button ui-widget ui-state-default ui-corner-all" id="ctl00_JobLogPageContentPlaceHolder_btnSerach" role="button" aria-disabled="false" onclick=" return open_search_box();" type="submit" jQuery1332289350068="6" value="Find Customer"/>




After partial postback it becomes :

HTML
<input name="ctl00$JobLogPageContentPlaceHolder$btnSerach" class="ui-button" id="ctl00_JobLogPageContentPlaceHolder_btnSerach" onclick=" return open_search_box();" type="submit" value="Find Customer"/>


Note the class attribute in both cases. Why IE is doing this ?
Posted

1 solution

You will have to use jquery's "live" in this case. The "live" call would maintain the bindings to various elements between partial postbacks. Refer to this page for details - http://api.jquery.com/live/[^]. Hope this helps!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900