Closing child window and refreshing Parent window automatically

Discussion in 'ASP .Net' started by =?Utf-8?B?U2lsZWVzaA==?=, Oct 13, 2004.

  1. Hi

    I have a btn in Parent.aspx page . On server_click() of the Btn, i am
    opening a new window called the child.apsx window. Child window also have a
    Btn. On serverClick of this Btn, I perform some operation . Once the
    operation is done, i have to close the child window, and refresh the parent
    window automatically.

    I am able to close the child window automatically , But not able to refresh
    the parent window.

    Please help
    Sileesh
    =?Utf-8?B?U2lsZWVzaA==?=, Oct 13, 2004
    #1
    1. Advertising

  2. hey. on the previous code i gave you, try adding this.

    after you're done load the close window script
    Dim strscript As String = "<script
    language=javascript>refreshandclose();</script>"
    If (Not Page.IsStartupScriptRegistered("clientScript")) Then
    Page.RegisterStartupScript("clientScript", strscript)
    End If

    -- now on the html portion of your webform inject this script :
    <head>
    <script language='javascripts'>
    function refreshandclose()
    {
    window.top.parent.location = 'parent.aspx';
    window.setTimeout('window.top.close();', 1000);
    }
    </script>
    </head>

    tell me if it works.

    "Sileesh" wrote:

    > Hi
    >
    > I have a btn in Parent.aspx page . On server_click() of the Btn, i am
    > opening a new window called the child.apsx window. Child window also have a
    > Btn. On serverClick of this Btn, I perform some operation . Once the
    > operation is done, i have to close the child window, and refresh the parent
    > window automatically.
    >
    > I am able to close the child window automatically , But not able to refresh
    > the parent window.
    >
    > Please help
    > Sileesh
    =?Utf-8?B?QWxsYW4=?=, Oct 13, 2004
    #2
    1. Advertising

  3. =?Utf-8?B?U2lsZWVzaA==?=

    Alex Guest

    What if you were to pass to the child window the url of the parent window.
    When you close the child window, redirect to the url of the parent window,
    using javascript, use something like...

    window.open(url);
    window.close();

    Or a combination thereof.

    Alex

    "Sileesh" <> wrote in message
    news:...
    > Hi
    >
    > I have a btn in Parent.aspx page . On server_click() of the Btn, i am
    > opening a new window called the child.apsx window. Child window also have

    a
    > Btn. On serverClick of this Btn, I perform some operation . Once the
    > operation is done, i have to close the child window, and refresh the

    parent
    > window automatically.
    >
    > I am able to close the child window automatically , But not able to

    refresh
    > the parent window.
    >
    > Please help
    > Sileesh
    Alex, Oct 13, 2004
    #3
  4. RE: Closing child window and refreshing Parent window automaticall

    Hi Allan

    It did work with some midifications.

    Thx Anyways
    Sileesh

    "Allan" wrote:

    > hey. on the previous code i gave you, try adding this.
    >
    > after you're done load the close window script
    > Dim strscript As String = "<script
    > language=javascript>refreshandclose();</script>"
    > If (Not Page.IsStartupScriptRegistered("clientScript")) Then
    > Page.RegisterStartupScript("clientScript", strscript)
    > End If
    >
    > -- now on the html portion of your webform inject this script :
    > <head>
    > <script language='javascripts'>
    > function refreshandclose()
    > {
    > window.top.parent.location = 'parent.aspx';
    > window.setTimeout('window.top.close();', 1000);
    > }
    > </script>
    > </head>
    >
    > tell me if it works.
    >
    > "Sileesh" wrote:
    >
    > > Hi
    > >
    > > I have a btn in Parent.aspx page . On server_click() of the Btn, i am
    > > opening a new window called the child.apsx window. Child window also have a
    > > Btn. On serverClick of this Btn, I perform some operation . Once the
    > > operation is done, i have to close the child window, and refresh the parent
    > > window automatically.
    > >
    > > I am able to close the child window automatically , But not able to refresh
    > > the parent window.
    > >
    > > Please help
    > > Sileesh
    =?Utf-8?B?U2lsZWVzaA==?=, Oct 14, 2004
    #4
  5. Sileesh,

    Check out Metabuilders' DialogWindow control. It's free and does a killer
    job at making it easy to program with and against popup dialog windows:

    http://www.metabuilders.com/Tools/DialogWindow.aspx

    "Sileesh" wrote:

    > Hi
    >
    > I have a btn in Parent.aspx page . On server_click() of the Btn, i am
    > opening a new window called the child.apsx window. Child window also have a
    > Btn. On serverClick of this Btn, I perform some operation . Once the
    > operation is done, i have to close the child window, and refresh the parent
    > window automatically.
    >
    > I am able to close the child window automatically , But not able to refresh
    > the parent window.
    >
    > Please help
    > Sileesh
    =?Utf-8?B?U29sZWwgU29mdHdhcmU=?=, Oct 14, 2004
    #5
    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. =?Utf-8?B?Vk1J?=

    Closing popup window when closing parent window?

    =?Utf-8?B?Vk1J?=, Feb 14, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    648
    Thomas Hansen
    Feb 15, 2007
  2. JohnE
    Replies:
    0
    Views:
    1,157
    JohnE
    Jan 10, 2010
  3. thomas
    Replies:
    0
    Views:
    225
    thomas
    Oct 23, 2003
  4. gokul
    Replies:
    3
    Views:
    711
    Grant Wagner
    Dec 2, 2003
  5. Replies:
    2
    Views:
    307
    Thomas 'PointedEars' Lahn
    Jun 25, 2004
Loading...

Share This Page