如何在asp.net中禁用浏览器后退按钮? [英] How to disable browser back button in asp.net?

查看:87
本文介绍了如何在asp.net中禁用浏览器后退按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何在asp.net中禁用浏览器后退按钮?我已经影响了很多问题。

请让我知道这个。





提前致谢

Hi,
How to disable browser back button in asp.net? I have affected lot of prblems.
Please let me know about this.


Thanks in advance

推荐答案

请阅读这篇文章,链接


以下提示将有助于学习它周围的一些事项:注销后的浏览器后退按钮问题 [ ^ ]
Following Tip will be of help to learn few things around it: Browser back button issue after logout[^]


首先,预告位: 不,不。试图禁用用户的后退按钮是非常糟糕的做法,这是他们的机器不是你的。

其次,坏消息:你不能做到这一点,而不是100%可靠。对于初学者来说,它依赖于Javascript,可以在客户端关闭。

第三,一些建议:找到另一种策略。您的应用程序更优雅地处理后退按钮请求会更好。



我可以进行更彻底的讨论此处 [ ^ ]。





有些情况下你可能觉得这是合适的(例如,你不能让步的要求,一个内联网应用程序治愈会比疾病更糟糕)你可以看看这篇文章 [ ^ ](无论如何都值得一读)。即便如此,我也会避免非常难以禁用后退按钮。
First, the preachy bit: Don''t. Trying to disable the user''s back button is very bad practice, it''s their machine not yours.
Second, the bad news: You can''t do it, not 100% reliably. For starters it relies on Javascript, which can be switched off on the client side.
Third, a bit of advice: find another strategy. It would be better for your app to handle back button requests more gracefully.

There is a more thorough discussion than I can make here[^].


There are circumstance where you might feel this is appropriate (e.g. a requirement that you can''t budge, an intranet app where the cure would be worse than the disease) you can take a look at this article[^] (which is worth a read anyway). Even so, I''d avoid disabling the back button pretty hard.


这篇关于如何在asp.net中禁用浏览器后退按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆