471,889 Members | 2,317 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,889 software developers and data experts.

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 2806
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 YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.