Using Modal Popup Extender with Master Page

jvoconnell used Ask the Experts™

I have a content page that uses a master page. A change needs to be made so that when a button on the content page is clicked a panel control (that had an AJAX modal popup control added) is displayed.

I am new to ASP.NET and cannot get this to work. I have been able to get this to work on a page that was not associated with a Master page. I'm not even sure where the Script Manager needs to be placed in this instance.

Any assistance is appreciated.

Thank you.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Robb HillSenior .Net Full Stack Developer

You place the script manager on the Master page then reference an instance of it for each and every conten page.  Keep in mind only one per page.

You would reference this on a content page as such in C#.  I can convert this to vb is you need me to.

ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);

below is the code for the modal popup....replace your with your own if ya like.
<asp:Panel ID="Panel1" runat="server">
    <asp:Panel ID="pnlMessaggioPop" Style="display: none; text-align: center; vertical-align: middle;"
        runat="server" BackColor="#FFFFFF" BorderColor="#DB6939" Width="300" Height="150"
        <br />
        <br />
        <asp:Label ID="lblMessagePop" Font-Size="Small" runat="server" Text="123" ForeColor="#DB6939"
        <br />
        <br />
        <asp:Button ID="btnYes" runat="server" Text="YES" />
        <asp:Button ID="btnNo" runat="server" Text="NO" />
    <asp:Button ID="btnDummyPopup" runat="server" Text="dummy" Style="display: " />
    <cc1:ModalPopupExtender ID="btnDummyPopup_ModalPopupExtender" runat="server" DynamicServicePath=""
        Enabled="True" TargetControlID="btnDummyPopup" PopupControlID="pnlMessaggioPop"
        BackgroundCssClass="modalBackground" OkControlID="btnYes" CancelControlID="btnNo">

Open in new window

Robb HillSenior .Net Full Stack Developer

put this in your master page header section:

<head runat="server">
    <title>Untitled Page</title>
            background-color: Gray;
            filter: alpha(opacity=70);
            opacity: 0.7;
Senior .Net Full Stack Developer
Put this in the body of your master page as well

        <table width="1000">
                <td colspan="1" style="width: 1001px; height: 80px; text-align: center">
                    <span style="font-size: 14pt"><strong>Master Page Header (My Menu Here)<asp:ScriptManager
                        ID="ScriptManager1" runat="server" EnablePartialRendering="true">
                <td colspan="1" style="width: 1001px">
                    <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
                <td style="width: 1001px">

Open in new window


robbhill - This worked perfectly!!!!  You really bailed me out. Thanks for the help. I appreciate it!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial