close a popup when parent form closes

how do i close a popup when the parent form is closed. the parent form is a .ascx file and the popup is html.
coletteck8Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
SicosConnect With a Mentor Commented:

Just store a reference to the window.

Declare a global javascript variable ...

var goWindow;

When you open the window open it like this ... goWindow = window.open(....);

When youre main window is closed use the unload event to close the other window like

goWindow.close();

Greetings,
Sicos
0
 
coletteck8Author Commented:
what code do i use to check if the main window is closed? can i use the onUnload method?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.