document的onkeypress事件判断所按键.

解决方案 »

  1.   

    inside url.aspx:<script language="javascript">
    function document.onkeydown()
    {
      if(event.keyCode == 27)
    window.close();
    }
    </script>
      

  2.   

    if you can do something on the client side, why do you want to go back to the server side, write out some javascript and come back to the browser and execute it?
      

  3.   

    原因如下:
    1、javascript不太熟悉
    2、不想在.aspx文件中显露代码
    3、感觉codebehind文件能够解决脚本执行问题,或者能够部分/全部替换现有的脚本
    4、用C#太爽了不知这些理由成立否?
      

  4.   

    to close a window, you have to execute some code on the client side, just paste the above code to your url.aspx, you are done!>>>>1、javascript不太熟悉
    if you want to develop ASP.NET applications, your life will be miserable without knowing javascript, start to learn it now>>>>2、不想在.aspx文件中显露代码
    what are you talking about? view the source in a browser, you will know your aspx pages generate javascript code too>>>>3、感觉codebehind文件能够解决脚本执行问题
    learn more about ASP.NET, you will know your 感觉 is an illusion>>>>4、用C#太爽了
    if so, I suggest you do not develop web applications