Click here to Skip to main content
15,914,452 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,
Here i want open popupdialog on tag onclick event and when Click on button inside popupdialog i want to redirect to another page.

Here problem when i am doing like this, popup window appears correctly but when i am going to click on button then it redirect to another page but all parent windows are remain same .
Please help me.

What I have tried:

This is my link

<li id="Li16" runat="server" style="display:none"><a  id="ApprvModel" onclick="OpenWindow()">Approval Pendancy</a></li>


This is my OpenWindow() javascript function
function OpenWindow() {
           window.open("frmEnterprise.aspx",
              "mywindow", "status=1, width=700, height=500, top=100, left=300");


       }

This is my
frmEnterprise.aspx
page

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server" style="width:450PX;height:150PX">
    <div style="width:450PX; height:auto;text-align:center">
        <asp:Label ID="Label1" runat="server" Text="Enterprise"></asp:Label>    
        <asp:DropDownList ID="enterpriseList" runat="server" Width="280px"  
            Height="22px">
        </asp:DropDownList>    <asp:Button ID="btnGO" 
            runat="server" Text="GO" onclick="btnGO_Click" />
    </div>
    </form>


This is my frmEnterprise.aspx code behind page

protected void btnGO_Click(object sender, EventArgs e)
      {
          int ind = enterpriseList.SelectedIndex;
          if (ind < 0)
          {
              ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Message", "alert('Select Enterprise')", true);
          }
          else
          {
              Session["DBName"] = enterpriseList.SelectedValue;
              Response.Redirect("frmApprovalHome.aspx");

              //Response.Redirect("frmApprovalHome.aspx?DBName=" + enterpriseList.SelectedValue + "");
          }
      }
Posted
Updated 14-Jan-18 22:58pm
v2
Comments
SujataJK 8-Jan-18 3:21am    
I solved above issue using
ClientScript.RegisterStartupScript(GetType(), "closePage", "<script type=\"text/JavaScript\">window.opener.location.href='RedirectAnotherPage.aspx'; window.close();");
ZurdoDev 8-Jan-18 8:16am    
Post in the Solution section so that this no longer shows as unanswered.

1 solution

I solved above issue using
ClientScript.RegisterStartupScript(GetType(), "closePage", "<script type=\"text/JavaScript\">window.opener.location.href='RedirectAnotherPage.aspx'; window.close();");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900