用回车提交
RegisterStartupScript("focus", "<script language=javascript>document.all('txtpwd').focus()</script>")
txtPwd.Attributes.Add("onkeydown", "if(event.keyCode==13) event.keyCode=9")
btnLogin.Attributes.Add("onfocus", "this.click();")
RegisterStartupScript("focus", "<script language=javascript>document.all('txtpwd').focus()</script>")
txtPwd.Attributes.Add("onkeydown", "if(event.keyCode==13) event.keyCode=9")
btnLogin.Attributes.Add("onfocus", "this.click();")
runat="server"></ASP:TEXTBOX>
解决方法:
1、是否没有进行事件绑定,有的时候在编辑时VS2003会将事件绑定删除,重新绑定一下再看;
2、如果不是以上问题,将imagebutton的TabIndex设为0