469,282 Members | 1,977 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

How to refresh calling window from a popup window

Opa
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.
Jun 13 '06 #1
3 3276
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.

Opa wrote:
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.

Jun 14 '06 #2
=?UTF-8?B?R8O2cmFuIEFuZGVyc3Nvbg==?= <gu***@guffa.com> wrote in
news:e$**************@TK2MSFTNGP02.phx.gbl:
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.

Opa wrote:
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.


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
()
--
*~!NumbLock!~*
Jun 14 '06 #3
NumbLock wrote:
=?UTF-8?B?R8O2cmFuIEFuZGVyc3Nvbg==?= <gu***@guffa.com> wrote in
news:e$**************@TK2MSFTNGP02.phx.gbl:
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.

Opa wrote:
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.


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.
Jun 14 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Giuseppe | last post: by
4 posts views Thread by Andrew Alger | last post: by
1 post views Thread by Targa | last post: by
5 posts views Thread by Peter | last post: by
7 posts views Thread by Ben Schumacher | last post: by
4 posts views Thread by Peter | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.