Using Postbacks in ASP.NET From showModalDialog pages.

If you have an ASP.NET page (.aspx) opened with the JavaScript showModalDialog() function and inside that page there is a form doing PostBack, when the PostBack is being done the page loads in another (popup) window. The easiest way to prevent this is to add the following tag inside the <HEAD></HEAD> tags of the ASP.NET page:

<base target=”_self”>

From: http://www.geekpedia.com/Question23_Using-showModalDialog()-with-an-ASP.NET-page-that-does-PostBack-opens-another-window.html

Advertisements

One thought on “Using Postbacks in ASP.NET From showModalDialog pages.

  1. That’s embarassing. I ran into this issue a few years back and, as I recall, worked around it by relaying the page through an iFrame – and that got baked into a library I’ve been using since. That works, of course, but it’s a bit kludgy compared to this simple work around. Thanks for posting.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s