开发者

Browser navigation, back button issue

开发者 https://www.devze.com 2023-03-06 00:45 出处:网络
I want to know how you guys deal with back button issues in yo开发者_如何学Gour web applications.

I want to know how you guys deal with back button issues in yo开发者_如何学Gour web applications.

I can not forbid users to click back button on their browser, but when they hit it, the page code doesn't run. So writing in page_load() makes no sense.

I have searched online and found this link: Disabling Back button on the browser. It does not work for me. Any idea?


There is no way to disable the back button. You can try to open your page/form in a new window so there would be nothing to navigate back to Normally, If I have a critical or lengthy form, I tend to maintain a dirty-flag and if the user starts entering something, the dirty-flag gets set and on save or submit it gets reset. You can use unload/beforeunload javascript event to see if the dirty-flag is set and ask for confirmation.

0

精彩评论

暂无评论...
验证码 换一张
取 消