want to clear chach on button in asp.net4.0 using c#.
Description :
i have form on which i use tab contorl when i click on save button i want to clear all chach of that form and reload that form as i run that form first time.
plz help
urgent
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Munesh SharmaPosted Sep 15, 2016, 5:32 AM
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0
The full code for this is:
HttpContext.Current.Response.AddHeader("Cache-Control", "no-cache, no-store, must-revalidate");
HttpContext.Current.Response.AddHeader("Pragma", "no-cache");
HttpContext.Current.Response.AddHeader("Expires", "0");
john janaPosted Sep 15, 2016, 3:37 AM
john janaPosted Sep 14, 2016, 4:30 AM
Suthish NairPosted Jun 29, 2011, 10:33 AM
If yes..
HttpContext.Current.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
HttpContext.Current.Response.Cache.SetValidUntilExpires(false);
HttpContext.Current.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Cache.SetNoStore();