How to refresh calling window from a popup window

G

Guest

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 and then do a refresh of the calling form.

Any ideas on how to get a reference to the calling form?
I tried window.parent.location.reload() , but it doesn't work.

Thanks a lot.
 
G

Guest

You can't refresh the calling window from the popup, as it's waiting for
the showModalDialog call to return.

When you close the popup, return a value (in window.returnValue) that
indicates to the code in the calling window that it needs to refresh itself.
 
N

NumbLock

You can't refresh the calling window from the popup, as it's waiting
for the showModalDialog call to return.

When you close the popup, return a value (in window.returnValue) that
indicates to the code in the calling window that it needs to refresh
itself.

Hi Guys. What opa wrote for a response to this can be true in a VB.net
windows forms application (depending on how the child form is called).
ASP.Net is a different animal. Web pages are stateless and have no
notion of modality. The javascript code to open the popup is processed
either during the page load, or is called in response to an onClick event
or something like that.

You can get a reference to the parent form using window.opener. To
refresh the parent form from the child you would use window.opener.reload
()
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

NumbLock said:
Hi Guys. What opa wrote for a response to this can be true in a VB.net
windows forms application (depending on how the child form is called).
ASP.Net is a different animal. Web pages are stateless and have no
notion of modality. The javascript code to open the popup is processed
either during the page load, or is called in response to an onClick event
or something like that.

You can get a reference to the parent form using window.opener. To
refresh the parent form from the child you would use window.opener.reload
()

The question actually has nothing at all to do with ASP.NET.

What the OP is talking about is the window.showModalDialog method, that
is specific for Internet Explorer. It opens a page as a modal dialog,
and waits for the page to close before returning to the parent page.

As the parent page is busy running the Javascript code that opened the
popup, it can't be refreshed until the popup is closed.
 

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,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top