globally prevent client browser caching

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!
 
K

Ken Cox [Microsoft MVP]

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.
 
S

Shiv Kumar

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top