1
In my current application, I have a content list page, which has a small form above to perform "filters" in Gridview below so yes select an item and go to the next page edit the same.
What happens is that when I’m on the editing page and try to go back to the listing page by clicking on the browser button, it displays "Expired Web Page" (only when I selected a filter for the listing page).
I have tried to use the code below, to try to intercept the load and force a reload of the page without the same values but without success.
private void Page_PreRender(object sender, System.EventArgs e)
{
if (IsPostBack && !Request.UrlReferrer.AbsolutePath.Contains("origem-listar.aspx"))
{
Response.Write("<html><head><script>location.replace('" + Request.Url + "');\n" + "</script></head><body></body></html>\n");
Response.End();
}
}
This is the normal behavior of the browser. All pages that have been obtained by a POST request expire. They don’t even reach the server, so the solution you used doesn’t work. It’s a protection system.
– Paulo Morgado
Is there any way to at least switch to the "last" page? I thought because in my system many users are used to clicking the back button of the browser and not the back button of the page. At least trigger an alert "You can’t come back here, use the back button on the page."
– Felipe Paiva