Using multiple Ajax ModalPopupExtender on same page in ASP.Net

akhter
 
on Jan 13, 2021 08:36 PM
1372 Views

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>

 

Download FREE API for Word, Excel and PDF in ASP.Net: Download
dharmendr
 
on Jan 14, 2021 03:42 AM

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>