在ASP。NET 2.0中如何按回车键就可以触发button事件??

解决方案 »

  1.   

    默认的在 input 等 html 元素上按回车就可以导致表单提交,也就相当于按钮点击。
      

  2.   

    但楼主用的是webcontrol button,
      

  3.   

    webcontrol button 提交本质上都需要通过触发 form 提交来实现。因此没有区别的。
      

  4.   

    textbox.Attributes.Add("onkeydown","if(event.keyCode==13)  {   document.all('But_Load').click();
    }");
      

  5.   

    txtbox.Attributes.Add("onkeydown","if(event.keyCode==13){document.all.IB_S_Gpdm.click();return false;}");
      

  6.   

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