locked
Ajax ModalPopupExtender1 not poping up RRS feed

  • Question

  • User1303004929 posted

    Dear team,

    i am trying to use the ModalPopupextender but it is not working.

    aspx page

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="testing.aspx.cs" Inherits="testing" %>
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
    
           <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:LinkButton ID="lnkDummy" runat="server"></asp:LinkButton>
    
    <cc1:ModalPopupExtender ID="ModalPopupExtender1" BehaviorID="mpe" runat="server"
        PopupControlID="pnlPopup" TargetControlID="lnkDummy" BackgroundCssClass="modalBackground" CancelControlID = "btnHide">
    </cc1:ModalPopupExtender>
    <asp:Panel ID="pnlPopup" runat="server" CssClass="modalPopup" Style="display: none">
        <iframe id="t" src="PrintRegistration.aspx"  runat="server"></iframe> 
            <br />
            <asp:Button ID="btnHide" runat="server" Text="Hide Modal Popup" />
    
    </asp:Panel>
        <asp:Button ID="rt" runat="server" Text="hai" OnClick="btnShow_Click" />
        </form>
    </body>
    </html>
    

    CS page

    using System;
    
    
    public partial class testing : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
        protected void btnShow_Click(object sender, EventArgs e)
        {
            Session["Name"] = "somedata";
            Session["Sex"] = "somedata";
            Session["dob"] = "somedata";
            Session["Batch"] = "somedata";
            Session["timing"] = "somedata";
            Session["Scroll"] = "somedata";
            Session["AttendCir"] = "somedata";
            Session["DisplayName"] = "somedata";
            Session["img"] = Server.MapPath("Images/4382.jpg");
            ModalPopupExtender1.Show();
    
    
        }
    }

     kindly help

    Monday, October 12, 2015 12:06 AM

Answers

  • User1724605321 posted

    Hi Madhan,

    Madhan seeman

    i am trying to use the ModalPopupextender but it is not working.

     Any error shown on the page when ModalPopupextender but it is not working ? I test your code and the page shows popup .Tested code is for your reference:

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
       <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server" />
            <asp:LinkButton ID="lnkDummy" runat="server"></asp:LinkButton>
    
            <cc1:ModalPopupExtender ID="ModalPopupExtender11" BehaviorID="mpe" runat="server"
                PopupControlID="pnlPopup" TargetControlID="lnkDummy" BackgroundCssClass="modalBackground" CancelControlID="btnHide">
            </cc1:ModalPopupExtender>
            <asp:Panel ID="pnlPopup" runat="server" CssClass="modalPopup" Style="display: none">
                <iframe id="t" src="NumericUpDown.aspx" runat="server"></iframe>
                <br />
                <asp:Button ID="btnHide" runat="server" Text="Hide Modal Popup" />
            </asp:Panel>
            <asp:Button ID="rt" runat="server" Text="hai" OnClick="btnShow_Click" />
    
    
        </form>

    Code behind:

            protected void btnShow_Click(object sender, EventArgs e)
            {
                ModalPopupExtender11.Show();
            }

    Best Regards,

    Nan Yu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, October 12, 2015 2:55 AM

All replies

  • User1724605321 posted

    Hi Madhan,

    Madhan seeman

    i am trying to use the ModalPopupextender but it is not working.

     Any error shown on the page when ModalPopupextender but it is not working ? I test your code and the page shows popup .Tested code is for your reference:

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
       <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server" />
            <asp:LinkButton ID="lnkDummy" runat="server"></asp:LinkButton>
    
            <cc1:ModalPopupExtender ID="ModalPopupExtender11" BehaviorID="mpe" runat="server"
                PopupControlID="pnlPopup" TargetControlID="lnkDummy" BackgroundCssClass="modalBackground" CancelControlID="btnHide">
            </cc1:ModalPopupExtender>
            <asp:Panel ID="pnlPopup" runat="server" CssClass="modalPopup" Style="display: none">
                <iframe id="t" src="NumericUpDown.aspx" runat="server"></iframe>
                <br />
                <asp:Button ID="btnHide" runat="server" Text="Hide Modal Popup" />
            </asp:Panel>
            <asp:Button ID="rt" runat="server" Text="hai" OnClick="btnShow_Click" />
    
    
        </form>

    Code behind:

            protected void btnShow_Click(object sender, EventArgs e)
            {
                ModalPopupExtender11.Show();
            }

    Best Regards,

    Nan Yu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, October 12, 2015 2:55 AM
  • User1303004929 posted

    Dear Nan Yu

      here by i am attaching the code for your reference 

    still not working

    https://www.sendspace.com/file/hlmocd

    Monday, October 12, 2015 3:18 AM
  • User1724605321 posted

    Hi Madhan,

    I have downloaded you code and test it , the code works fine . Does any error shown on your page ? And have you registered the ajax control successfully?

    https://ajaxcontroltoolkit.codeplex.com/

    https://sites.google.com/site/benchia1979/programming/csharp/howtoregisterajaxtoolkitinwebconfig

    Best Regards,

    Nan Yu

    Monday, October 12, 2015 9:52 PM