I have an ASP.net application (c#).
When a user is on a specific page, they click a link on this page that takes them to a child page, displaying the product details.
If the user clicks the browser back button, I need the parent page to be refreshed to its initial state. ie all text boxes that had data typed need to be blank, any hidden fields reset etc. Basically i need a CTRL-F5 when a user clicks back.
Disabling the back button is not an option.
I need this only on certain pages.
In IE and Firefox i can get this working without an issue. But with chrome the textboxes still contain their values as do the hidden fields. If I hit CTRL-F5 in Chrome, the page is correctly reset to its initial state.
This is the code I have tried.
<%@ OutputCache Location="None" VaryByParam="None" %>
and this:
Response.Buffer = true;
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetAllowResponseInBrowserHistory(false);
Response.Cache.SetNoStore();
and this:
Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
Response.Cache.SetValidUntilExpires(false);
Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
I have also tried a variety of these in different combination, but with no success.
thanks