close child form when parent form is closed.

Discussion in 'ASP .Net' started by =?Utf-8?B?UGF1bA==?=, Nov 22, 2004.

  1. 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.
     
    =?Utf-8?B?UGF1bA==?=, Nov 22, 2004
    #1
    1. Advertising

  2. 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" <> ¦b¶l¥ó
    news: ¤¤¼¶¼g...
    > 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.
     
    Lau Lei Cheong, Nov 23, 2004
    #2
    1. Advertising

  3. 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" <> ¦b¶l¥ó
    news: ¤¤¼¶¼g...
    > 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.
     
    Lau Lei Cheong, Nov 24, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Denon
    Replies:
    1
    Views:
    582
    Saravana [MVP]
    Nov 14, 2003
  2. muthu
    Replies:
    2
    Views:
    4,876
    muthu
    Apr 7, 2006
  3. zEE
    Replies:
    1
    Views:
    6,144
    Islamegy®
    Apr 25, 2006
  4. Noel Dolan
    Replies:
    0
    Views:
    238
    Noel Dolan
    Jul 18, 2004
  5. Bitswapper
    Replies:
    5
    Views:
    150
    Prasad, Ramit
    Aug 27, 2013
Loading...

Share This Page