Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8105197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:06:02+00:00 2026-06-06T00:06:02+00:00

I stumbled across a little problem with an ASP.NET Web Application. I got a

  • 0

I stumbled across a little problem with an ASP.NET Web Application.

I got a couple buttons on my page that I want to access by pressing my Enter key (Depending on which TextBox is focused).

Googled helped me, I thought, but no.

This is what I found:

tbEmail.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btRegister.UniqueID + "').click();return false;}} else {return true}; ");

Source

This does not seem to work, it still presses another button that I do not want to be pressed at this moment.

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:06:03+00:00Added an answer on June 6, 2026 at 12:06 am

    It looks like you’re using Web Forms.

    You can wrap what you’re doing inside of a Panel and set the DefaultButton property inside of the panel.

    <asp:Panel ID="LoginPanel" runat="server" DefaultButton="btLogin">
      <asp:TextBox ID="txtUser" runat="server" />
      <asp:TextBox ID="txtPass" runat="server" />
      <asp:Button ID="btLogin" runat="server">Login</asp:Button>
    </asp:Panel>
    

    When the user has entered data in either txtUser and txtPass and then hit the Enter key, they will trigger the button btLogin.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've recently stumbled across a few blogs that say the ASP.NET Ajax Library is
I stumbled across this problem in F#. Suppose, I want to declare two types
i'm working on a little iOS project, and i stumbled across a problem with
I am making a network based application and I've stumbled across a little dilema.
I recently stumbled across a problem when starting my application via JNLP. I now
I recently stumbled across an article that claims Microsoft is banning the memcpy() function
about a year ago I stumbled across a nice feature in Java that I
we've recently stumbled across the excellent Dispatch for ASP FTP deployment plug in. It
I stumbled across this: http://en.literateprograms.org/Vending_Machine_%28java%29 It is a java vending machine, I want to
Just stumbled across the new ClientId (aka client_identifier) variable that is available in Oracle

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.