Showing posts with label everytime. Show all posts
Showing posts with label everytime. Show all posts

Wednesday, March 28, 2012

Modal Popup Extender and Page Refresh ?

I use Modal Popup Extender and there are two buttons, login button and cancel button...Everytime any of the buttons are clicked whole page is refreshed. I want to stop that for cancel button, but don't know how that will work for login as I want some underlying events to happen when that is clicked.

How can I achieve the above functionality ?

Wrap the modalpopup in an updatepanel to take advantage of partial postbacks. You can also assign the cancel button as the cancelcontrolid of the modalpopup so that it will close the popup using JS without a postback.

Wednesday, March 21, 2012

ModalPopup - content shows briefly when page loads

Hi,

I have a some problem with the modalpopup control. Its on everytime a full postback happens, the browser "displays" all the content of my modalpopup, in way that how it's going to look like when you dont add the extender to your panels. The panels then "disappear" after the page is loaded, and the modalpopups work as they are supposed to.

how do i prevent the panels from "blinking"/showing on full page postbacks?

Add style="display:none;" to the panels.


this seems to work. thanks!

however i have one question. before, I was adding display:none; to my panels through the css class on a separate css file. it wouldnt work that way since the panels will disappear forever. it only works when i put display:none; on the <asp:Panel> from the html source. why is it like that?


I believe that the modalpopup works by toggling the style attribute but if you have display:none permanently set in the CSS then it isn't going to work. Bit of a pain I know but not a huge deal to add it to the panel.