How to refresh a Modal Dialog window

In one of our screens we were required to refresh a Modal Dialog window in order to redraw the entire screen. Trying to refresh a Modal Dialog window will resolve in a new window with the same url.

A possible solution is to create a new “container” file (MyContainer.aspx) which will only have an IFrame with the “real” page(MyPage.aspx) in it as src; Your main page (MyMainPage.aspx) will open the “container” as Modal Dialog instead of the “real” page. The trick is that the IFrame can refresh itself so we’ve created a Modal Dialog which behaves as a normal window. if you need to set the Modal Dialog returnValue parameter you can call “top.returnValue=….” from the “real” page.


The downside of this solution is QueryString delegation – if you need to send a QueryString parameter(s) to your “real” page you will now have to pass it via the “container” file.