public knowledge blog_load(sender Virendra)

                                                                                                                          Nothing shocks me, I am a Software Engineer.

showModalDialog and postbacks in ASP.NET

Posted by Virendra Dugar on March 23, 2009

I learned something new today that when window.showModalDialog is used to open a modal window on the client from parent page using  javascript. And whenever postback occurs in the modal window, it would open up a new window.  A normal window.open works fine, this is the problem only with modal window.

Finally I found a solution which is very simple by just including the below tag in the <head> section of the modal Window.

<base target="_self"/>

 And also we need to set the output cache property to “1” otherwise next time when you try to open the modal window, it will take it from cache.

<% @ OutputCache Duration="1" VaryByParam="none"%>

Enjoy..

Advertisements

4 Responses to “showModalDialog and postbacks in ASP.NET”

  1. Gowri said

    Excellent I was trying this for 2 days…..

  2. Razi said

    Hi.
    U Can Use For This Problem.

  3. Razi said

    Hi.
    U Can Use iframe For This Problem.

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

 
%d bloggers like this: