单击注销按钮时如何禁用浏览器的后退按钮 [英] How to disable back button of browser when click on logout button

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

问题描述

尊敬的先生

我有一个有关禁用浏览器后退按钮的查询.

我希望当我单击注销按钮时,后退按钮会自动禁用,以便没有人可以返回到asp.net应用程序中的上一页.

请尽快发送解决方案.

感谢所有

Dear Sir

I have a query regarding disable browser back button.

I want that when i click on logout button then back button is automatically disable so that no one can go back to previous page in asp.net application.

Please send the solution as soon as possible.

Thanks to all

推荐答案

,请参见此技巧
see this trick Browser back button issue after logout[^]


在页面的页面加载事件中写入以下代码:

Write following code in page load event of your page:

Response.Cache.SetCacheability(HttpCacheability.NoCache);

Response.Cache.SetAllowResponseInBrowserHistory(false);



它不会禁用后退按钮,但会禁用后退按钮功能.



It will not disable the back button but it will disable the back button functionality.


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

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