Saturday, 13 October 2007

Preventing the modal popup from showing when a page loads

This is actually a lot easier than I thought it would be!

Basically when you link a model popup to a panel and run it you will notice that for a brief second (longer depending on the amount on your page) the panel will be visible then hidden.

This is done so that if your browser doesn't support javascript you will still get to see and use the panel - however I think that if this is going to be an issue for you perhaps you should handle it slightly more elegantly!

Anyway, to stop the panel from showing simply add a style='display:none' attribute to the panel e.g.:-
<asp:Panel ID="pnlDontShowMe" RunAt="server" style="display:none">
This will sort out the problem!

Hope this helps!

No comments: