Handle Enter Key on Website (ASP and VB)

Posted by Andrew on Stack Overflow See other posts from Stack Overflow or by Andrew
Published on 2010-06-13T18:58:54Z Indexed on 2010/06/13 19:02 UTC
Read the original article Hit count: 259

Filed under:
|
|
|

So I have a website with multiple asp controls. When I press enter inside by login form, the search function runs because it's the first thing found on the page.

How would I handle the enter button so that when the active textbox is for the login form, the loginbutton code actually runs rather than the searchbutton.

One last problem is that the login controls are inside a loginview so the hierarchy shows that the asp:textbox and asp:button for logging in are inside 3 tags like so:

<loginview>
   <login>
      <logintemplate>
      //controls are here.
      </logintemplate>
   </login>

Just a note that all controls are asp and that all code is prefered in VB. Thanks

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about vb.net