You would think that just performing a (control name) CollapsiblePanelExtender1.collapse = True would collapse the panel; however, this will not work by itself. This is due to the fact that there is a short delay between the first rendering of the page and the running of the Javascript to modify it. To have the panel collapse you will need to add one more line, so your code will look like this.
CollapsiblePanelExtender1.Collapsed = True;
CollapsiblePanelExtender1.ClientState = "true";
You can also prevent the PopControlExtender from briefly showing controls it contains by placing the controls within a Panel Control and setting the Panel Control's visibility style to hidden. This will stop the annoying flickering that happens when the page is first rendered.
8 comments:
Awesome. Thanks a million!
Wow, thanks for that, just what I was looking for.
Great, that what was I needed only the other way around, I needed to auto rxpand... However, could you please explain solving the flicker experience that I too get. I dont quite get how you mean.
You would just need to add the following to your panel control:
asp:panel ID="Panel1" runat="server" Height="100px" Width="200px"
style="visibility: hidden"
asp:panel
You are not a developer.
YOU ARE A GOD.
lolz thx
Thank you!
I'm glad you found it helpful.
Does anyone have the code to 'open' the panel with a button click? C#.
Also, when I close the panels there is a full page flash/refresh. Anyway to make a clean closing motion instead?
Post a Comment