Posted by: sandeep bharati | August 19, 2010

Problematic Modal Dialog in ASP.net

Once we tried using modal dialog window for editing records. Following javascript is used to open the edit page.

window.showModalDialog( editPageUrl, “Update records”, “dialogWidth:350px;dialogHeight:300px”);

This edit page was fetching records from database in its page_load event. We faced following issues.

I> When clicked on the submit button, the parent page opens in a new window:
To resolve this just add <base target=”_self”> in head part of modal window.

II> After editing record using this modal window, if we try to open the edited record it displays the old values. This seems to because of caching. So just turn of the caching for the modal window page.  To do this add following lines before <html> tag of the aspx page. <%@ OutputCache Location=”None” VaryByParam=”None” %>

Advertisement

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 )

Connecting to %s

Categories

Follow

Get every new post delivered to your Inbox.