简体   繁体   中英

Chrome back button skips page

I've run into a very annoying problem that I'm having an impossible time solving. The problem is that for an unknown reason, Chrome is not registering a page in it's history and so when the user clicks the back button, it goes back 2 pages instead of 1.

The page progression is as follows:

Search-form.aspx -> searching.aspx -> search-results.aspx -> result.aspx

More specifically, when I get to the result.aspx page in chrome and hit back, it skips search-results.aspx and jumps all the way back to searching.aspx.

Thoughts?

Your page_load on searching.aspx is sending the browser immediately to another page. The only thing it ever presents the user with is a loading graphic. No links are clicked to get to the next page and Chrome is considering searching.aspx to be the last most relevant step.

Consider using javascript (I prefer jQuery) to present the loading info and cut out searching.aspx entirely. On search-results.aspx use javascript to do an asynchronous (AJAX) call back to the server for the results. While the results are being returned, you can display a nice little graphic telling them to be patient while their results load.

If javascript is not an option, then consider letting the browser's loading functions be enough. I have tried to use an intermediate page in the past for similar things and it's just a mess. Don't get tangled in that web. Either do some asynchronous loading or let the browser handle telling them their page is loading. Most people will be used to, after clicking a search button, waiting for the page to load slightly longer.

EDIT If you want a quick and simple solution, put a button on searching.aspx. Make the button do the page redirect. This way an actual form submission occurs and chrome should register the next page in its history. You could just make searching.aspx be a quick message with an OK button. They click OK and off you go.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM