views:

2960

answers:

4

I'm using Microsoft AjaxControlToolkit for modal popup window.

And on a modal popup window, when a postback occured, the window was closing. How do i prevent from the closing action of the modal popup?

+2  A: 

You can call Show() method during postback to prevent the modal popup window from closing

MyModalPopoupExtender.Show()

Ricky Supit
+1  A: 
protected void Page_Load(object sender, EventArgs e)
{
    if (Page.IsPostBack)
    {
        // reshow
        MyModalPopup.Show()
    }
}
Jon Erickson
A: 

i guess that works but not in my case. i have a user control that opened in a modal popup and this user control makes postback itself. so in that user control i have no modal popup property.

i guess, i have to create an event for my user control, and the page that opens the modal popup have to reopen it in this event.

yapiskan
A: 

Hello,

Like you prolly already know, the modal popup is clientside only, yeah you can gather informations in it during the postback, but if you do a postback he will hide 100% of the time.

Of course, like other proposed, you can do a .show during the postback, but it depends on what you need to do.

Actually, I don't know why you need a postback, if it's for some validations try to do them clientside.

Could you tell us why you need to do a postback, maybe we could help you better ! :)

ForceMagic
Hey, thanks for your answer but I really don't remember the problem :) I guess we got rid of it.
yapiskan
hahaha !!! ok then XDMaybe you could post your solution (the way it's working atm) if you don't mind. I'm pretty curious about the case and I would like to see how you can do it!
ForceMagic