Mar 11, 2011 12:03 PM|e_man_online|LINK
In ASP .NET 2.0, I've created a user control which is meant to work as a dropdown or popup by using an
<input type="button" id="btnTogglePopup" runat="server" style="display:inline"... /> and a
<div id="divPopup" runat="server" style="display:none" ... />
the rest of the controls are contained inside this div, and they do mantain their values between posts, etc.
The problem I'm having is that when a page containing this control posts back, the state visible/hidden of the div is not maintained. If the user had the popup open, after the postback, it will display closed.
I've read a bunch by now about ViewState & ControlState, and have the save and load contol state methods working, but when I step thru them they load old values (setting the popup to hidden all the time), and the popup doesn't work! I've come to think that
b/c when the button is clicked, the visible state of the div is changed in client code w/o a postback, maybe I have to maintain this state info in a hidden field or something like that??? At the same time I don't want to have a hidden field if it's unnecessary,
and I may just doing something wrong. Any help will be greatly appreciated.
Thanks in advance,