473,416 Members | 1,548 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,416 software developers and data experts.

Refresh Parent window from child window causes problems

Raj
Hi All,
I have a problem with trying to refresh the parent window from
child window in order to update data in the parent window.

The sequence of events are
1) I click a button in the parent window to open a child window thru
javascript
window.open

2) I have some functionality in the child window that changes the data
in the parent window.

3) I need to refresh the parent window on child window closing

I read some posts here and I did window.opener.location.reload(true)
and window.opener.reload(true). when I did this, IE came up saying
"This page cannot be refreshed without resending information, Click
retry to send the information again ...." and all that crap when I hit
this the page is refreshed, but the ItemCommand of the parent window
had the same event that opened the child window and it opened it
again.

So even when I close it, I end up with the same window again.

Can someone please help me to refresh my parent window without this
message box and I dont want to have the child window open again

TIA
Raj
Nov 17 '05 #1
2 23470
Hmmm, to me it seems quite obvious that the Refresh function re-opens your child window. This was exactly what happened when you loaded your page the last time - and Refresh just repeats this loading process.

I'd set the parent window to a new location in order to have it "forget" its current state. Either by setting it to "opener.location=opener.location;" or if this doesn't work "opener.location=null; opener.location=opener.location;" or something.

HTH,
Axel Dahmen

------------------------------
"Raj" <ph*********@yahoo.com> schrieb im Newsbeitrag news:26**************************@posting.google.c om...
Hi All,
I have a problem with trying to refresh the parent window from
child window in order to update data in the parent window.

The sequence of events are
1) I click a button in the parent window to open a child window thru
javascript
window.open

2) I have some functionality in the child window that changes the data
in the parent window.

3) I need to refresh the parent window on child window closing

I read some posts here and I did window.opener.location.reload(true)
and window.opener.reload(true). when I did this, IE came up saying
"This page cannot be refreshed without resending information, Click
retry to send the information again ...." and all that crap when I hit
this the page is refreshed, but the ItemCommand of the parent window
had the same event that opened the child window and it opened it
again.

So even when I close it, I end up with the same window again.

Can someone please help me to refresh my parent window without this
message box and I dont want to have the child window open again

TIA
Raj


Nov 17 '05 #2
The problem lies in the way that WebForms work (POSTing back to themselves),
and the way the browser works. When a browser tries to refresh a page that
is the result of a form submission, it is necessary to re-submit the form,
as the form was generated as a result of a previous POST request.

Your only solution is to not refresh the browser in the parent window, but
to send a fresh GET request for the page, as if hyperlinked (as in
"parent.location = 'someURL'"). This may be problematic, as you probably
want to retain the state of the page as it presently exists, and a fresh
request for the page will return it in its' initial state. A workaround for
this would be to append a QueryString to the request, so that the
server-side class can read the QueryString in order to update itself to the
proper state. Another workaround would be to re-post the parent form (as in
"parent.forms[0].submit()"). Again, you would have to make sure that the
parent page could restore itself to its' correct state based upon the
results of the post.

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Big things are made up of
lots of Little things.

"Raj" <ph*********@yahoo.com> wrote in message
news:26**************************@posting.google.c om...
Hi All,
I have a problem with trying to refresh the parent window from
child window in order to update data in the parent window.

The sequence of events are
1) I click a button in the parent window to open a child window thru
javascript
window.open

2) I have some functionality in the child window that changes the data
in the parent window.

3) I need to refresh the parent window on child window closing

I read some posts here and I did window.opener.location.reload(true)
and window.opener.reload(true). when I did this, IE came up saying
"This page cannot be refreshed without resending information, Click
retry to send the information again ...." and all that crap when I hit
this the page is refreshed, but the ItemCommand of the parent window
had the same event that opened the child window and it opened it
again.

So even when I close it, I end up with the same window again.

Can someone please help me to refresh my parent window without this
message box and I dont want to have the child window open again

TIA
Raj

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: MEM | last post by:
Hello, I'd like to refresh the main or top most browser window from a child window. Specifically, child popup A is opened by a main browser window then child popup B is opened from within child...
0
by: Brad White | last post by:
Overview: I have a custom web app that has an 'Inbox' that refreshes every 30 seconds. One user uses Outlook to host the web page. Using IE, the refresh works fine. If the user is working in...
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...
7
by: Ben Schumacher | last post by:
How can I refresh the parent page from a popup window that was created using window.showmodaldialog? I would like to accomplish this using vbscript if possible.
3
by: Opa | last post by:
Hi , I have a form with javasript which launches a popup via the showModalDialog() method. I get the dialog to open, now I am trying to first get a reference to the calling form from the popup...
3
by: Natygan | last post by:
Hi, I've got a Web page which can become a parent window : some links use "window.open" to open the desired link into a new child window. This parent window has got an auto-refresh...
4
by: minay111 | last post by:
Hello Experts, i've to open child window whose content type is "application/pdf"; Now i want to refresh the parent window after loading of the child window. My problem is that i can not write...
2
by: =?Utf-8?B?U2lsa0NpdHlGbG9yaWRh?= | last post by:
I have a web page "PgA" with a GridView. I open another page "PgB" in a new window. On PgB, they do some things that affect the underlying data for the GridView on PgA. When the user is done...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.