You must Sign In to post a response.
  • Category: ASP.NET AJAX Modal Popup Control

    Helo Developers,

    I'm using ajax ModalPopupExtender in my code. After login i am calling another page in popup window. My problem is when i have complete the work on called page and then click the called page event and what to redirect the page to another page that page open in popup up window. But i want to open it in normal form. Below is my code for Login in design page and called page

    Login Page

    <ajaxToolkit:ModalPopupExtender ID="mp5" runat="server" PopupControlID="Panel1" TargetControlID="btnlogin"
    CancelControlID="btnClose" BackgroundCssClass="modalBackground">
    <asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" align="center" style = "display:none">
    <asp:ImageButton ImageAlign="Right" ID="btnClose" Width="32px" Height="32px" ImageUrl="~/images/Close.png" runat="server" />
    <iframe style=" width: 550px; height: 500px; border:0" id="irm1" src="Post_task.aspx" runat="server"></iframe>

    Post Task Page :

    <div style="text-align: left">
    <asp:Button ID="btn_Contine_Budget" Width="350px" runat="server" class="btn btn-default" Text="Get Quotes Now" OnClick="btn_Contine_Budget_Click" />

    Post Task Code Page :

    protected void btn_Contine_Budget_Click(object sender, EventArgs e)
  • #764488
    Hi Gaurav,
    on onClientClick of btnClose, write javascript function as follows:
    function CloseAndRedirect()
    var url = "My_Task.aspx";
    var mytaskWindow =, 'title', 'height=200,width=150');
    if (window.focus)
    { mytaskWindow.focus(); }
    OR try to find "mp5" inside btn_Contine_Budget_Click() and write mp5.Hide(); before line Response.Redirect("My_Task.aspx");

    Hope it helps.
    Shashikant Gurav

  • #764492
    But how can i find mp5 bcoz my modal popup control is on login page and i am currently working on Post_task Page

  • #764524

    If you want to redirect to another page with popup then use below sample code.

    "alert('Redirection'); window.location='" +
    Request.ApplicationPath + "/NewPage.aspx';",true);

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • #764533
    Hi Gaurav,
    Ok.. you can use jquery on Post Task Page as follows:
    <script src="//"></script>
    <script type="text/javascript">
    $('#btn_Contine_Budget').click(function() {
    return true;

    or you can write a javascript function on OnClientClick of btn_Contine_Budget button as follows:

    <script type="text/javascript">
    function Redirect()
    Hope it helps.
    Shashikant Gurav

  • Sign In to post your comments