How to close all the child windows when parent window get closed?

  • Thread starter Thread starter zEE
  • Start date Start date
Z

zEE

How to close all the child windows when parent window get closed? in
ASP.net application
through scripting..
 
Simply When you open new windows assing it to variables.
<script language=javascript type=text/javascript>
var win1;
var win2;
var win3;
function openNewWindow()
{
win1 = window.open("page1.aspx");
win2 = window.open("page1.aspx");
}
function CloseChildren()
{
win1.close();
...........
}

then in body onunload event call CloseChildren()



Note: each new window must assign to diffrent variable then check them all
if not null (NaN) They close it..
 
Back
Top