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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Munesh SharmaRank #174 · 13.9K reputationPosted Sep 15, 2016, 1:32 AM EDT
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");
Suthish NairRank #92 · 22.8K reputationPosted Jun 29, 2011, 6:33 AM EDT
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();
john jana8 reputationPosted Sep 14, 2016, 12:30 AM EDT
john jana8 reputationPosted Sep 14, 2016, 11:37 PM EDT