How to ensure that the page is not loaded from the cache when hit the back button of the browser in ASP.NET?
Printable View
How to ensure that the page is not loaded from the cache when hit the back button of the browser in ASP.NET?
Just don't cache the page.
I think he means stopping the browser caching the page.
The first method sets the cache-control HTTP header. This header controls how docuemtns are cached on the cache capable devices.Code:Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetAllowResponseInBrowserHistory(false);
The second method indicates whether the response will be kept in the browser history.
HTH
DJ
Shall I place this code in the Page_Load event. I am using vb.net as the code behind for asp.net
That'll do it!
DJ
Thanks a bunch.