473,324 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 4217
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: jb61264 | last post by:
Is it possible to refresh a parent browser window when a "child" browser window has been closed using the button in the upper right corner of the browser? When I refer to child window, I mean...
5
by: Ron L | last post by:
I have an MDI application with a number of child windows. In each child window I am catching the Closing event and having the child window decide if it should set cancel to true. The intent here...
1
by: Chris Bruce | last post by:
In my application I need a way to distiguish between the following events: 1. When a user closes an MDI child window. 2. When the user closes the MDI parent window which subsequently closes the...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
4
by: Steve Barnett | last post by:
I've created a simple MDI application and have designated the Window menu to keep track of the mdi children. When I first load an mdi child, it's caption consists of "File: no file loaded" and this...
3
by: Vinutha | last post by:
Hi, I am using javascript to close my child window and after closing child window, i want to refresh parent window. So, this is the script function i am using, <script...
4
by: Buddha | last post by:
Hello, I posted this on two forums, without too much help .. and I am kinda stuck in this. I need to refresh the parent page from the second child window which is opened by the first child and...
2
by: Jeff | last post by:
I have a Form parent window with a list view on it. When I click on an item I open another form to edit the details - this is not and cannot be a dialog window. When I close the child window I...
7
by: sumanta123 | last post by:
Dear All, How will we do in JSP page on closing the parent window the child windows should close automatically. I will show my code Please i will show you my code. For HTML link function...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.