Clearing Page Cache

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stephen

    #1

    Clearing Page Cache

    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.Htt pCachePolicy' does not contain a definition for
    'SetAllowRespon seInBrowserHist ory'

    Is there anything similar I can do in ASP.NET 1.0 to achieve the same thing.


    //clear down the cache
    Response.Cache. SetCacheability (HttpCacheabili ty.NoCache);
    Response.Cache. SetAllowRespons eInBrowserHisto ry(false);
    if (Session["UserName"].Equals(string. Empty))
    {
    Response.Redire ct("index.aspx" );
    }
Working...