Modal dialogs and browser caching
Posted by CJ on September 11, 2007
There seems to be quite a number of behavioural differences between window.open and window.showModalDialog.
I was having an issue when opening a showModalDialog the page didn’t seem to be raising the page load event, but the window.open was working perfectly.
IE apparently caches modal forms so I needed to remove this default behaviour. I entered the following two lines in the page load event and all seems to be fine:
Response.Expires = 0;
Reponse.Cache.SetNoStore();
I also always forget to place the following element in the <head> element to stop the .showModalDialog creating a new window instance.
<base target=”_self”>