Reload the page when the user comes from the back button

I have a common error page to which any error processed will be redirected. I have an admin page, when the user causes an error and the user gets to the error page, clicking the "Back" button on the error page causes the admin page to load incorrectly.

So what I need is a way to reload the admin page when I came from the error page. I tried installing the cache, etc. On the admin page and check the postback, but nothing works. Setting up the cache does not seem to do anything, and any javascript on the admin.ready page of the function does not call. Are there other ways to achieve this?

EDIT:

I should also mention that I noticed that the table is missing 2 cells that I recently added. This makes me believe that there is an old state of the page where it is cached somewhere, although clearing the browser cache and rebooting my server does not help at all.

Edit2:

Also, setting window.onload () gets nuked when I return to the admin page

+8
javascript html
source share
2 answers

So it turns out that this is just an IE9 issue. My onload method just wasn't called. Works great in other browsers.

The fix I had to make to make it work in IE9 was also adding a query string to the page, so when I get back to the page, IE9 will return to the browser, cut the query string has changed or needs to be re-evaluated.

Thank you guys or help helped me find the problem.

0
source share

You should be able to take care of this by overriding OnInit with this code:

 public class ProductBrowser : Page { protected override void OnInit(EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetNoStore(); Response.Cache.SetExpires(DateTime.MinValue); //EDIT: Set the value to FALSE Response.Cache.SetAllowResponseInBrowserHistory(false); base.OnInit(e); } } 

See this question for more information: Back button update page

EDIT

To clear the cache, check this:
Manually flush the ASP.NET cache server for a single application / website?

+2
source share

All Articles