Original http://www.cnblogs.com/super-cj/archive/2012/11/07/2758472.html
Making webpages "obsolete immediately" is sometimes a very useful function, for example, preventing users from using backend services to destroyProgramLogic, the Program actively Refreshes a page, and so on. The most effective method in ASP is:
Response. cachecontrol = "no-Cache"
In this case, response. expires =-1 is not required or meets our requirements.
But in the ASP. NET era, when I am still confused about using this statement, I found that the response field in msdn is described as follows:
Sets the cache-control HTTP header to public or private.
[C #]
Public String cachecontrol {Get; set;} property value
"Public" or "private ".
Exceptions
Argumentexception: cachecontrol is an invalid Cache control value (not private or public ).
How can I only assign "public" and "private" values? However, one experiment knows that Ms is the publisher. As long as the HTTP Head Value of cache-control is valid, it is acceptable, including no-cache.
In addition, the functions of this method are still the same as those in ASP. Of course, it seems that. Net officially recommends this method:
Response. cache. setcacheability (system. Web. httpcacheability. nocache );
This effect is exactly the same as that of the former.
Finally, it seems that only IE is correct. Firefox does not buy this account ......
Simply Add the following sentence to page_load:
Response. cache. setcacheability (system. Web. httpcacheability. nocache );
The page will be prompted as long as the user moves back.