Saturday 30 May 2015

Stop Caching of Page from Browser in Asp.Net

if you want open page every time from server then stop browser caching.

for example after logout from application, 
back/forward button of browser may be display your confidential page,
so stop caching of these pages by writing single line in C# 
in page_load or any other method.

Response.Cache.SetNoStore();

OR

Response.CacheControl = "private, no-store";

No comments:

Post a Comment