Hi,
with ASP.NET v2.0
You could have
<body onkeypress="if(event.keyCode==13){postForTheButton }" >
<form id="form1" runat="server">
<div>
<asp:TextBox ID="emailid" runat="server" />
<asp:TextBox ID="passwd" TextMode="Password" runat="server" />
<asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" />
<script type="text/javascript" >
function postForTheButton()
{
<%=Page.ClientScript.GetPostBackEventReference(btn Submit,"")%>
}
</script>
</div>
</form>
</body>
If you use v1.0, replace Page.ClientScript.GetPostBackEventReference with
Page.GetPostBackEventReference
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
<co*******@gmail.com> wrote in message
news:11*********************@e56g2000cwe.googlegro ups.com...
Hi All,
I have two textboxes(Emailid,passwd) and a Button Submit in my
Webform.I have set focus to Email textbox by using JavaScript.Now how
to call the Submit button_click event when we hit Enter key from the
Key board?Can any one give me the Code samples for this problem?
Thanx,
Krish.