我想在登录对话框中按回车键触发登录按钮事件,请问如何做啊,我在网上查的代码都不行啊1不能触发事件!在ASP.NET2003中怎么做啊!急!

解决方案 »

  1.   

    see:
    http://www.aspxboy.com/private/showthread.asp?threadid=307
      

  2.   

    楼主,ASP.NET2003这个名字很有创意阿?
      

  3.   

    前台
    function GetFocus()
    {
    if(event.keyCode==13)
    {
    document.getElementById("Button1").click();
    return false;
    }
    }------------------------
    后台
    TextBox1.Attributes.Add("onkeydown","return GetFocus();");
      

  4.   

    function document.onkeydown()
      {  
        with(window.event)
        if (event.keyCode==13)
        {
         var id= "<%=btnlogin.ClientID%>";
         document.getElementById(id).click();
        }
      }