方法一:

Txtpassword.Attributes.Add(
"onkeypress", "if(event.keyCode   ==   13)
{ document.getElementById("btnSearch").click();}");


===============================================================

方法二:


写在你的textbox_onkeypress事件里

if e.key=keys.enter then
  button2_onclick(sender,e)
endif

===============================================================

方法三:

前台
function GetFocus()
{
if(event.keyCode==13)
{
document.getElementById(
"Button1").click();
return false;
}

}


------------------------
后台
TextBox1.Attributes.Add(
"onkeydown","return GetFocus();");
 
posted on 2008-07-04 15:41  apple  阅读(183)  评论(0)    收藏  举报