How to disable Browser Caching for a specific View in ASP.NET MVC Environment?
I want to disable Browser Caching in a specific View.
I tried Response.Cache.SetCacheability(HttpCacheability.NoCache);
in a controller that returns the View, but that开发者_StackOverflow does not work.
Any suggestions are greatly appreciated.
Thank you.
Try using the meta tag directly
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
put that at the top of your header. although the Response.Cache call is supposed to just put that in for you.
精彩评论