I am developing a web application in ASP.NET and on some pages I want to prevent them from caching the data using the following code:
protected override void OnInit(EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
Response.Cache.SetExpires(DateTime.MinValue);
base.OnInit(e);
}
This works like it should, but now when the user tries to refresh the page after a postback (e.g. saving the data) the browser informs the user that action will be caused twice if he proceeds and asks you if you want to continue or not. If you cancel this on Chrome or Firefox the page still has its current state - which is exactly what I want, but in IE it is invalidated.
Is there any way to achieve the same behaviour for Internet Explorer?