In a form with some asp:TextBox & asp:Button control, which event will hitting the Enter key fires? I want the user to select the required button (eg. Add, Edit) so that the correct action can be triggered. <BR><BR>Any idea is greatly appreciated.<BR><BR>Thanks in advance,<BR>BenI believe the enter key always selects the first button/image button/link button on the page. If you have multiple buttons and you want this to change, create a 1x1 pixel clear button in fron of the first one and set it to the values of the one you want hit. Below show an example of forcing a continue button on enter as opposed to a back. ASP.NET controls will work the same way.<BR><BR>ie.<BR><BR><input type="image" src=http://aspmessageboard.com/archive/index.php/"clear.gif" height="1" name=continue value=continue width="1" alt=""><BR><input type="image" src="back.gif" alt=""" & name="back" value="back" width="60" height="20"><BR> <BR><input type="image" src="Continue.gif" alt=""" & name="continue" value="continue" width="80" height="20"><BR>Yes, it is true that the first button seems to be the 'active' button whenever the enter key is hit.<BR>Here's a method I use with script. Keep in mind if for ANY reason you don't want the enter button to fire the submit (like if a user is filling out a textarea, you would want them to be able to hit enter to force a line break) then be sure to exclude them before the 'setActive'.<BR><BR><BR><html><BR><head><BR><script><BR><BR>document.onkeydown = ProcessKeyDown;<BR><BR>function ProcessKeyDown()<BR>{<BR> if(window.event.keyCode == "13"){<BR> document.frm.cmdSave.setActive()<BR> }<BR>}<BR><BR></script><BR></head><BR><body><BR><form id="frm" name=frm><BR><input type=submit id=cmdSave value=Save><BR></form><BR></body><BR></html><BR><BR>hth<BR><BR>mattThank u for the egs. I'll try up later.