1

Code to forces the page to load when the browser back and forward button are used.

        Response.Buffer = true;
        Response.ExpiresAbsolute = DateTime.Now.Subtract(TimeSpan.FromMilliseconds(1));
        Response.Expires = 0;
        Response.CacheControl = "no-cache";
        Response.Cache.SetNoStore();
        Response.AppendHeader("Pragma", "no-cache");

Using this piece of code I remove the copy of page from cache and reload page again when (browser)back button click from the next page but I found "Webpage has expired" with detail note "The local copy of this webpage is out of date, and the website requires that you download it again".

here i am looking to recreate the previous page.

Javascript can help here or not.

4

1 回答 1

0

Change:

    Response.Buffer = true;
    Response.ExpiresAbsolute = DateTime.Now.Subtract(TimeSpan.FromMilliseconds(1));
    Response.Expires = 0;
    Response.CacheControl = "no-store";
    Response.Cache.SetNoStore();
    Response.AppendHeader("Pragma", "no-cache");
    Response.post-check=0;
    Response.pre-check=0;

Go through http://blogs.msdn.com/b/ie/archive/2010/07/14/caching-improvements-in-internet-explorer-9.aspx for further information about caching.

于 2013-04-10T12:27:15.327 回答