Using multiple Ajax ModalPopupExtender on same page in ASP.Net

Last Reply one month ago By dharmendr

Posted one month ago

How to use two model popup Extender on same page

on New button it is opening but on Credit button it is not opening popup window.

<asp:Button ID="btn_New" runat="server"  Text="New" Width="74px" OnClick="btn_New_Click" />     
<cc1:modalpopupextender ID="mp1" runat="server"  PopupControlID="Panl3" TargetControlID="btn_New" CancelControlID="btn_close" BackgroundCssClass="Background"> </cc1:modalpopupextender>                        
<asp:Panel ID="Panl3" runat="server" CssClass="Popup" align="left" style = "display:none">
    <asp:Button ID="Button2" runat="server" Text="Close" />
    <iframe  style=" width: 980px; height: 750px;" id="irm1" src="partypy2.aspx" runat="server"></iframe>
    <br/>
</asp:Panel>
                                       
<asp:Button ID="btn_CR" runat="server"  Text="Credit" Width="74px" OnClick="btn_CR_Click" />  
<cc1:modalpopupextender ID="mp2" runat="server"  PopupControlID="Panl4" TargetControlID="btn_CR" CancelControlID="btn_close" 
    BackgroundCssClass="Background"> </cc1:modalpopupextender>                        
<asp:Panel ID="Panl4" runat="server" CssClass="Popup" align="left" style = "display:none">
    <asp:Button ID="Button1" runat="server" Text="Close" />
    <iframe  style=" width: 980px; height: 750px;" id="Iframe1" src="partycrdt.aspx" runat="server"></iframe>
    <br/>
</asp:Panel>

 

You are viewing reply posted by: dharmendr one month ago.
Posted one month ago

Hi akhter,

Use below code.

HTML

<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</cc1:ToolkitScriptManager>
<asp:Button ID="btn_New" runat="server" Text="New" Width="74px" OnClick="btn_New_Click" />
<cc1:ModalPopupExtender ID="mp1" runat="server" PopupControlID="Panl3" TargetControlID="btn_New"
    BackgroundCssClass="modalBackground" CancelControlID="btn_close">
</cc1:ModalPopupExtender>
<asp:Panel ID="Panl3" runat="server" CssClass="Popup" align="left" Style="display: none">
    <asp:Button ID="btn_close" runat="server" Text="Close" />
    <iframe style="width: 380px; height: 350px;" id="irm1" src="Default.aspx" runat="server"></iframe>
    <br />
</asp:Panel>

<asp:Button ID="btn_CR" runat="server" Text="New" Width="74px" OnClick="btn_New_Click" />
<cc1:ModalPopupExtender ID="mp2" runat="server" PopupControlID="Panel4" TargetControlID="btn_CR"
    BackgroundCssClass="modalBackground" CancelControlID="Button1">
</cc1:ModalPopupExtender>
<asp:Panel ID="Panel4" runat="server" CssClass="Popup" align="left" Style="display: none">
    <asp:Button ID="Button1" runat="server" Text="Close" />
    <iframe style="width: 380px; height: 350px;" id="Iframe1" src="Default.aspx" runat="server"></iframe>
    <br />
</asp:Panel>