469,338 Members | 8,161 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

refresh parent window on close showModalDialog?

Is it possible to make the parent window refresh when a modal dialog is
closed? I know I can use

window.opener.location.reload(true);

for a 'normal' window, but this doesn't work for showModalDialog. It is
modal as far as the client is concerned but not the server...

In my app I have a datagrid on the main aspx page, I pop up a modal dialog
to edit a record. On closing the modal dialog I'd like to refresh the
datagrid with the new data.

Simon
Nov 17 '05 #1
2 15803
We use showModalDialog a lot.
As solution we put on parent web form server side button with style =
"display:none"
inside client-side function which calls to showModalDialog we "press" this
button in case showModalDialog returns true:

if(showModalDialog(...))
{
document.all("btnRefresh").click();
}

in server-side event onclcik of this button(I called it "btnRefresh") you do
what you want.(rebind etc...)
HTH

"Simon Storr" <ss****@sdasolutions.com> wrote in message
news:un**************@tk2msftngp13.phx.gbl...
Is it possible to make the parent window refresh when a modal dialog is
closed? I know I can use

window.opener.location.reload(true);

for a 'normal' window, but this doesn't work for showModalDialog. It is
modal as far as the client is concerned but not the server...

In my app I have a datagrid on the main aspx page, I pop up a modal dialog
to edit a record. On closing the modal dialog I'd like to refresh the
datagrid with the new data.

Simon

Nov 17 '05 #2
Nice solution - that will do it nicely :o)

Thanks for your help guys!

Simon

"Anatoly" <an******@gilat.com> wrote in message
news:OQ**************@TK2MSFTNGP12.phx.gbl...
We use showModalDialog a lot.
As solution we put on parent web form server side button with style =
"display:none"
inside client-side function which calls to showModalDialog we "press" this
button in case showModalDialog returns true:

if(showModalDialog(...))
{
document.all("btnRefresh").click();
}

in server-side event onclcik of this button(I called it "btnRefresh") you do what you want.(rebind etc...)
HTH

"Simon Storr" <ss****@sdasolutions.com> wrote in message
news:un**************@tk2msftngp13.phx.gbl...
Is it possible to make the parent window refresh when a modal dialog is
closed? I know I can use

window.opener.location.reload(true);

for a 'normal' window, but this doesn't work for showModalDialog. It is
modal as far as the client is concerned but not the server...

In my app I have a datagrid on the main aspx page, I pop up a modal dialog to edit a record. On closing the modal dialog I'd like to refresh the
datagrid with the new data.

Simon


Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by sramruttun | last post: by
5 posts views Thread by Peter | last post: by
7 posts views Thread by Ben Schumacher | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by haryvincent176 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.