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

Z

zEE

How to close all the child windows when parent window get closed? in
ASP.net application
through scripting..
 
I

Islamegy®

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..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top