By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,825 Members | 1,281 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,825 IT Pros & Developers. It's quick & easy.

refresh parent window on close showModalDialog?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.