How can I remove a browser's cache server-side, using ASP.NET?

Posted by Noman on Stack Overflow See other posts from Stack Overflow or by Noman
Published on 2012-12-03T04:32:47Z Indexed on 2012/12/03 5:04 UTC
Read the original article Hit count: 157

Filed under:
|

How can I remove a browser's cache server-side, using ASP.NET (C#)?

A coupon shows by itself (I believe it comes from cache as I did also browse for other apparel sites). It breaks my JavaScript as well as my server-side code, as I am using an UpdatePanel for Ajax, and it duplicates the UpdatePanel's ID. I have renamed the UpdatePanel's ID, but it makes no difference. It generates "Invalid view State" exception. The coupon name is "FastSave"

What I have tried:

Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET