close child form when parent form is closed.

G

Guest

Hi this is related to a previous post, hopefully just a bit clearer
description o the problem. I have a parent form that opens a new form (child
form) while still leaving the parent form open. Although the child form has a
close button (with java script) if the user navigates the parent form to
another form the child form is still open. Just wondering if there is a way
to close the child form when the user navigates away with the parent form?
navigate to form 2, child form still
open-want to close automatically.
****************** *****************
form 1-btn 2 goto form2* * form 2 was form 1 *
btn1- open child form * *****************
****************** browser window1
browser window 1

***************
* child form *
* btn-close this frm*
**************
browser window 2
Paul G
Software engineer.
 
L

Lau Lei Cheong

You'll probably need to save the handle described in previous post to a
hidden text control then save it to session during postback.

Then you can build a common routine that'll use the saved session variable
to generate the closeall() javascript/vbscript you needed.
 
L

Lau Lei Cheong

Here is another approach:

Do not use Response.Redirect() and use a web page with frameset to wrap it,
then save the handle to hidden variables on the outer page. In this fashion,
you can also specify onunload event that will close all child windows
whenever the main window closes. Very cool!
 

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,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top