globally prevent client browser caching

  • Thread starter Thread starter gu4y
  • Start date Start date
G

gu4y

Hello All,

Is there anyway to globally prevent client browser caching in ASP.NET?

Otherwise, I will have to put:
Response.Cache.SetCacheability(HttpCacheability.NoCache);
in every page's code-behind...

Thanks!
 
Maybe not exactly what you want, but if you are using user controls, you can
sneak it into one of them. For example I have a usercontrol that holds
standard footer text.

Just put it in the page load event.
 
You can use the global.asax file for this. That is use your code in the
global asax file. The HttpApplication class (Global) has events, and the
event you should use for this purpose is PostRequestHandlerExecute.
 
Back
Top