views:

33

answers:

1

Hi

I have checked this thread.
http://stackoverflow.com/questions/1160105/asp-net-mvc-disable-browser-cache

And wondering if I can put the answer inside page_load ?

If not how do I disable the cache on for a single page?

Thanks!

A: 

And wondering if I can put the answer inside page_load ?

Yes you can as long as you have not set same Header before.

At the end you can place them, and check if your page get the cache header by inspecting the headers on the browser (chrome and firefox have utilities for that)

Aristos
So I have to remove the headers <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Expires" content="Tue, 01 Jan 1980 12:12:02 GMT">And I can use the code ?
rlee923
@rlee923 Yes, I think is better to add the cache to the header and not inside the html header code. In my pages I set the cache on every page (or one time on master page)
Aristos
Thanks a lot ! (15 char req)
rlee923