禁用asp.net中的ESC键 [英] disable ESC key in asp.net

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

问题描述

如何使用java脚本禁用ESC键的功能?

解决方案

你永远不应该尝试禁用它。此密钥从页面加载中逃脱。如果你设法以某种方式禁用它,它将不是任何合法的;没有人会说你谢谢你。 :-)

-SA


 < ;   pre  >  <   script     type   =  text / javascript >  

函数ESCclose(evt){

if(evt.keyCode == 27){
//执行任务
alert(不允许逃脱! );
}
}

< / script > < / pre >


how to disable the functionality of the ESC key using java script?

解决方案

You should never try to disable it. This key escapes from the page loading. If you manage to disable it somehow, it would not be anything legitimate; no one will say you thank you. :-)
—SA


<pre><script type="text/javascript">

function ESCclose(evt) {

if (evt.keyCode == 27){
 //Do your task
  alert("Escape is not allowed!");
}
}

</script></pre>


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

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