469,133 Members | 1,443 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Closing child window and refreshing Parent window automatically

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
Nov 18 '05 #1
4 4050
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

Nov 18 '05 #2
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" <Si*****@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
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

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

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

Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by jb61264 | last post: by
5 posts views Thread by Ron L | last post: by
1 post views Thread by Chris Bruce | last post: by
4 posts views Thread by Steve Barnett | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.