Posted on: 10/17/2014 7:26:13 PM | Views : 350

Hi,
I just found a very annoying behavior of the TextBox control in ASP.NET.  When users press the enter key after entering data, it somehow seems to fire the load event of a button next to it.  When there are so many textboxes to fill up it becomes really distracting.
Does anyone know how to prevent this behavior?  It used to be that you press enter when entering data and you stay on the same page.   I followed one advice to add this attribute to the textbox:  onkeydown="return (event.keyCode !=13).  It worked on a web app with a Master Page but few web pages.  It doesn't work in my current web app project where I have many web pages.  I also tried setting the DefaultFocus and DefaultButton but it doesn't work. 
I'm using Visual Studio 2013 Premium and Windows 7 OS on .NET 4.5 framework.
Appreciate any help.

Go to the complete details ...