refresh parent window on close showModalDialog?

S

Simon Storr

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
 
A

Anatoly

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
 

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

Top