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 582759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:43:17+00:00 2026-05-13T14:43:17+00:00

Have a real head-scratcher here: I have a page with several controls on it,

  • 0

Have a real head-scratcher here: I have a page with several controls on it, and a ASP:Button or two. When I’m in a control, and hit the Enter key, it acts like I clicked the submit button, which I don’t actually want to do at this point in time.

The button is not in a ASP:Panel with a DefaultButton set, it has no OnClientClick attribute, I can see no JavaScript that watches for the Enter key… Why is it firing?

If I create a standard .ASPX page and put a text box and a button on it, run it and hit the enter key, the button is ignored, e.g. the click event doesn’t fire. This is the behaviour I expect, but am not getting.

In short, what else could cause a button to think it’s the default button for the page?

Thank you,

Mike K.


Ok, here’s my test page markup:

<p><asp:Label ID="uxNameL" runat="server" AssociatedControlID="uxName">Name</asp:Label><asp:TextBox ID="uxName" runat="server"></asp:TextBox></p>
<p><asp:Button id="uxSubmit" runat="server" Text="Submit" onclick="uxSubmit_Click" /></p>
<asp:Literal ID="uxOut" runat="server" EnableViewState="false"></asp:Literal>

Here’s what happens in code:

    protected void uxSubmit_Click(object sender, EventArgs e)
    {
        uxOut.Text = uxName.Text;
    }

When I run the page, and enter some text in the textbox and press Enter – ha, would you look at that: In IE 8, the button event is ignored, e.g. the page just reloads, but in FF, it submits the form…

Hmmmmm.

  • 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-05-13T14:43:17+00:00Added an answer on May 13, 2026 at 2:43 pm

    I believe (and stand to be corrected), but if you have a form, with an input button of type submit, then when you hit enter, it’ll fire that button click.

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

Sidebar

Related Questions

I'm onto a real head scratcher here ... and it appears to be one
I got a real head scratcher here and I am in need of some
This one is a real head scratcher... I have a number of command links
Here's what i have been beating my head against for a day now. I
I have two tables detail and head. The detail table will be written first.
I have tried a session.php script which runs at the head of each page
I have the following page : <html> <head> <link type=text/css href=css/smoothness/jquery-ui-1.8.14.custom.css rel=stylesheet /> <style
I have a class with two definitions of ordering. (In the real problem, one
I have the following HTML page (page is simplified here as it is a
Say I have real, dimension(0:100) :: realResults and I want to iterate over realResults

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.