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);
}
 
Joined
Sep 9, 2006
Messages
1
Reaction score
0
=?Utf-8?B?TWljaGFlbCBFY2tsaW4=?= said:
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);
}

I just registered in this forum to send a quick THANK YOU. This finally solved a problem I've been working about 3 hours on.
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top