更多登录控制问题 [英] More login control questions

查看:76
本文介绍了更多登录控制问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个登录控件,当我单击登录按钮时,我会转到下一页.

我单击退格键,然后转到上一页.

我想禁用退格按钮

I have a login control, and when I click on the login button I go to next page.

I click on backspace and I go to previous page.

I want to disable backspace button

推荐答案

两件事

1-标头是简要说明的地方,而不是您的整个问题
2-您的问题是向您表明要做的事多于要求我们为您完成工作的地方
3-标记可以帮助人们找到正确的问题,因此,如果您正在使用ASP.NET,请放上它.
4-只有最缺乏经验和能力的程序员才会尝试禁用后退"按钮.没有办法不能轻易击败它.尝试这样做的人通常会尝试,因为他们的代码以其他方式被破坏了.这些都可以解决.修复它们,不要在您的代码中添加hack.总的来说,我觉得您不应该被允许在需要安全的任何网站上工作,并且在考虑这样做之前,您需要进行大量阅读.
A couple of things

1 - the header is the place for a brief description, not your whole question
2 - your question is the place to show you''ve done more than ask us to do your work for you
3 - the tagging helps people find the right questions, so put ASP.NET if you''re using it
4 - only the most inexperienced and incompetent programmers bother trying to disable the back button. There is no way of doing it that cannot be easily defeated. People who try to do this, usually try because their code is broken in other ways. These can all be fixed. Fix them, don''t add hacks to your code. Overall, I feel like you need to not be allowed to work on any site that needs security, and that you need to do a lot of reading before you consider doing such a thing.


此页面将停止后退按钮的工作 [
This page will stop the back button from working[^]


However Alt+LeftArrow will still function.


HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
        HttpContext.Current.Response.Cache.SetNoServerCaching();
        HttpContext.Current.Response.Cache.SetNoStore();
        Session.Abandon();









and

<script type="text/javascript" language="javascript">
window.history.forward(1);
document.attachEvent("onkeydown", my_onkeydown_handler);
function my_onkeydown_handler()
{
switch (event.keyCode)
{
case 116 : // F5;
event.returnValue = false;
event.keyCode = 0;
window.status = "We have disabled F5";
break;
}
}
</script>


这篇关于更多登录控制问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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