Wednesday, March 21, 2012

How can I make the collapsible panel extender NOT remember client state on post back?

I see one of the "features" of the collapsible panel extender is that it remembers it's client state after a post back, but I don't want that behavior after a successful post back. I have a form to fill out inside the collapsible panel and after post back, I want the panel to close as an indication that it was completed.

I've tried turning view state off on the collapsible panel and loading the change onPreRender and nothing seems to work. Is this possible?

Hi,

You can setMyExtender.EnableClientState = false; beforeOnInit (i.e. inOnPreInit) to disable ClientState. You could also leave ClientState enabled and manually close the panel when you want withMyExtender.Collapsed = true; MyExtender.ClientState = true.ToString();.

Thanks,
Ted

No comments:

Post a Comment