Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I prevent the closing of modal popup window(ModalPopupExtender) on postback?

Tags:

asp.net

I'm using Microsoft AjaxControlToolkit for modal popup window.

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

like image 299
Ali Ersöz Avatar asked Sep 03 '08 14:09

Ali Ersöz


2 Answers

Put you controls inside the update panel. Please see my sample code, pnlControls is control that holds controls that will be displayed on popup:

<asp:Panel ID="pnlControls" runat="server">

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
               <asp:Button ID="TestButton" runat="server" Text="Test Button" onclick="TestButton_Click" />
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>         
        </ContentTemplate>

    </asp:UpdatePanel>

This will do the job for you :)

Best regards, Gregor Primar

like image 189
Gregor Primar Avatar answered Oct 09 '22 09:10

Gregor Primar


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

MyModalPopoupExtender.Show()
like image 34
Ricky Supit Avatar answered Oct 09 '22 08:10

Ricky Supit