window.showModalDialog, databinding and IsPostBack

Z

Zak Lomakus

[VS 2005/ASP.NET 2.0 question]

Hi,

From my main page (default.aspx) I am calling another .aspx (e.g.
otherpage.aspx) page through Javascript using window.showModalDialog.

otherpage.aspx has a databoud control (webchart), bound to a SQLDataSource.
The first time otherpage.aspx is opened from default.aspx the databinding
occurs and the page_load occurs on otherpage.aspx. When the user closes that
modal form by clicking the close box ("X") at the top right corner of the
modal form, the modal form (otherpage.aspx) closes.

However, the next time otherpage.aspx is called from default.aspx (again
using window.showModalDialog) there is no databinding and page_load does not
occur anymore. It looks like otherpage.aspx is still in memory and therefore
does not do its page_load or databinding.

Is there a way to remove otherpage.aspx from memory once the user closes it
by clicking the form 'X' close button or is there a way to call the
databinding from default.aspx through javascript - or is there a simpler
way?....


-> Denis
 
G

Guest

Zak,
Try to call ExpirePageCache function on form_load:

private void ExpirePageCache()
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.Now-new TimeSpan(1,0,0));
Response.Cache.SetLastModified(DateTime.Now);
Response.Cache.SetAllowResponseInBrowserHistory(false);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top