c# - avoid page reload and controls' state setting to default on hitting back button -
i have 2 pages, page1 , page2. on page1, have checkbox below update panel , few controls in update panel such radio button , combo boxex. client side.
<asp:checkbox><asp:checkbox> </br> <asp:updatepanel id="updatepanel1" runat="server"> <contenttemplate> <div id="div1" runat="server"> <asp:panel id="pnl1" runat="server" </div> </panel> </contenttemplate> </updatepanel> </br> <asp:button></button> when user checks checkbox(which outside update panel), pnl1 gets visble , when unchecked, pnl1 gets invisible. checkbox checked. when click button on page1, redirects page2. on page2 , hit button go on page1. when go on page1, want see checkbox checked. using mozilla. tell me please,how can achieve this.
your input appreciated. thank you.
if redirect page first called page_load function. sure, have checking checkboxes in function. (also if have button on page , click it, call function again). can use boolean variable (which crappy solution) or session.
for example, that:
protected void page_load(object sender, eventargs e) { if(session["abc"] == null) { ... ... session["abc"] = "something"; } }
Comments
Post a Comment