如何使用asp.net禁用Internet Explorer中的Backspace按钮 [英] How to disable the Backspace button in Internet explorer using asp.net

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

问题描述

大家好,



在我的项目中,我想在IE中禁用Backspace按钮。



因为,在注销后,用户按下后退/后退按钮。它是最后访问的页面。





谢谢。

Hi all,

In my project, I want disable the Backspace button in IE.

Because, the after logout, the user press back/backspace button. it goes last accessed page.


thanks.

推荐答案





你可以使用服务器端解决方案或客户端(javascript解决方案)



服务器端




注销后使用此代码

Hi,

You can use either server side solution or client side (javascript solution)

Server side


After logging out use this code
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetAllowResponseInBrowserHistory(False)





客户端




在每页的头部包含以下文字。





client side


include the following text in the head portion of each page.

<script>
    history.forward();
</script>





希望这会有所帮助。



谢谢



hope this will help.

Thanks


Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetAllowResponseInBrowserHistory(False)


Response.Cache.SetExpires(DateTime.Now.AddDays(-1))

响应。 Cache.SetCacheability(HttpCacheability.NoCache)

Response.Cache.SetAllowResponseInBrowserHistory(False)
Response.Cache.SetExpires(DateTime.Now.AddDays(-1))
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetAllowResponseInBrowserHistory(False)


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

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