Closing child window and refreshing Parent window automatically

G

Guest

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
 
G

Guest

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.
 
A

Alex

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
 

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

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top