lsmyth1717
Programmer
I've found this code to help me with my session logout problem. Before I had a session and when I logged out everything worked fine and I was brought to the log out page but when i clicked the back button in IE I was brought back into the cached version of the page in IE. I added the below two lines to the page load and now the page cache is cleared and and I can check the session variable and do the nessesary.
My problem is that this doesn't seem to work in ASP.Net version 1.0. I get the following error.
'System.Web.HttpCachePolicy' does not contain a definition for 'SetAllowResponseInBrowserHistory'
Is there anything similar I can do in ASP.NET 1.0 to achieve the same thing.
//clear down the cache
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetAllowResponseInBrowserHistory(false);
if (Session["UserName"].Equals(string.Empty))
{
Response.Redirect("index.aspx");
}
My problem is that this doesn't seem to work in ASP.Net version 1.0. I get the following error.
'System.Web.HttpCachePolicy' does not contain a definition for 'SetAllowResponseInBrowserHistory'
Is there anything similar I can do in ASP.NET 1.0 to achieve the same thing.
//clear down the cache
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetAllowResponseInBrowserHistory(false);
if (Session["UserName"].Equals(string.Empty))
{
Response.Redirect("index.aspx");
}