469,613 Members | 1,280 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,613 developers. It's quick & easy.

close child form when parent form is closed.

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.
Nov 18 '05 #1
2 2714
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.

"Paul" <Pa**@discussions.microsoft.com> 在郵件
news:A1**********************************@microsof t.com 中撰寫...
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.

Nov 18 '05 #2
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!

"Paul" <Pa**@discussions.microsoft.com> 在郵件
news:A1**********************************@microsof t.com 中撰寫...
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.

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Colin Graham | last post: by
7 posts views Thread by Alice | last post: by
5 posts views Thread by Stan Sainte-Rose | last post: by
3 posts views Thread by =?Utf-8?B?RGF2ZVA=?= | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.