Link to home
Start Free TrialLog in
Avatar of KavyaVS
KavyaVS

asked on

How to make two popup windows remain open

It's a  .Net 3.5 web application. Opening the 2nd popup window closing the first one.
I want both of them in open state. The sequence is as follows:

In the Page1.aspx GridView row command 1st popup window (page2.aspx) will be opened.
In the page2.aspx button click event 2nd pop up window (page3.aspx) will be opened.
After  page3.aspx opened as pop up from page2.aspx(that is popup from page1),page2.aspx is automatically  getting closed. I still want it to be in open state.

How to make it happen(two popups in open state at the same time).

Page1.aspx code
protected void gv_RowCommand(object sender, GridViewCommandEventArgs e)
        {
         
            try
            {
             
              GridView grd = (GridView)sender;
              switch (grd.ID.ToString())
              {
                  case "grdStudent":
                      {
                          int iRowIndex = Convert.ToInt32(e.CommandArgument);
                       
                          string StudentNo = (grdStudent.DataKeys[iRowIndex]["student_no"]).ToString();
                          int ID = Convert.ToInt32(grdStudent.DataKeys[iRowIndex]["ID"]);
                           
                          Page.ClientScript.RegisterStartupScript(this.GetType(), "Pop up", "<script language='javascript'>" + "window.open('/Forms/Page2.aspx?param1=" + StudentNo + "&param2=" + ID + "',null,'height=1000, width=1000,status= no,resizable= yes, scrollbars=yes, toolbar=no,location=no,menubar=no ');</script>");
                          break;
 
                       
                      }
               }
 
            }
            catch (Exception ex)
            {
               
            }
            finally
            {
                SQLComm.Dispose();
            }
 
        }

Page2.aspx code
protected void Button_Click(object sender, EventArgs e)
        {
               Button btn = (Button)sender;
               switch (btn.ID)
               {
                     case "btnDetails":
                       {
                            string classNo = (ViewState["class_no"]).ToString();
                         
                           int StudentID = Convert.ToInt32(ViewState["StudentID"]) ;
                             Page.ClientScript.RegisterStartupScript(this.GetType(), "Pop up", "<script language='javascript'>" + "window.open('/Forms/Page2.aspx?param1=" + classNo + "&param2=" + StudentID + "',null,'height=1000, width=1000,status= no,resizable= yes, scrollbars=yes, toolbar=no,location=no,menubar=no ');</script>");
                           break;
                       }
}
}

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Paul Jackson
Paul Jackson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KavyaVS
KavyaVS

ASKER

Thanks