Thursday, 20 August 2009

Web Page Modal Dialog opens new window on postback

If you have a web page that's opening as a Modal Dialog (using window.showModalDialog or similar) and you are finding your button post backs are opening up a new browser window... here's the code that generally stops it happening. At the top of your head tag insert the following:

<base target="_self" />

In some instances this won't work. If not then pop this onload script in the body:

<body onLoad="'myDialogWindow' ......>

and set the base tag to this instead:

<base target="myDialogWindow" />

No comments:

Post a Comment