How to disable Enter key pressed inside TextBox to avoid submission or Postback in Asp.Net?

 Posted by vishalneeraj-24503 on 1/3/2015 | Category: ASP.NET AJAX Interview questions | Views: 1779 | Points: 40
Answer:

In textbox definition,we have to write below code on onkeydown event as:-
<asp:TextBox ID="txt_emp_first_name" 

runat="server" onkeydown = "return(event.keyCode!=13);"></asp:TextBox>

Here,13 is keyboard Enter button key code.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response