Visual Studio .NET - Refresh Main Page when a Modal window is Close

Asked By Ralph Acido on 16-Feb-07 10:34 PM

Hello everyone! I have a problem how to refresh the main when a modal window is closed. In my Main page I have a datagrid that contains a record and I have Modal window use to add records after saving the record and close the modal window my main window does not refresh.


There are a number of ways - Robert Stanton replied to Ralph Acido on 17-Feb-07 07:47 AM

Probably the easiest is something like this

In your modal

window.returnValue = "doReload";

Then in your mainpage

var modal = window.showModal....
if (modal == "doReload") {
   window.location = window.location;

What I like about this approach is that you can return all sorts of values and perform different actions.

thanks a lot it works - Ralph Acido replied to Robert Stanton on 19-Feb-07 02:33 AM

thank you very much.. it works