How to control enter button on the client PC in ASP.Net

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default How to control enter button on the client PC in ASP.Net

    Does anybody know how to control enter button on the web
    form? It seems to if the user hits enter button at run
    time then it fires submit button click event. I have also
    noticed that if the page does not have a submit button
    then the button that was first placed on the form at
    design time is fired and I do not want that to happen. Is
    there any way to control enter button behaviour?
    Many thanks
    Simon
    Simon Fainveits Guest

  2. Similar Questions and Discussions

    1. disabling enter button (revisited)
      I posted this question before, but all the answers given were not feasible either because it's a VERY long form (so I don't want to make everything...
    2. How control which button has focus [ENTER]
      Hello, I'm facing a problem with the behavior of the key while editing items in a datagrid. I would like to make sure that the cancel button is...
    3. attaching client script to toolbar button control...
      Hello, I am sick and tired of ochestrating server and client side scripts. Basically I am using toolbar from IE web controls and want to attach...
    4. Default Button to Catch <ENTER> key
      Hi, It's a login screen, so users enter their ID/Password and hit <ENTER> instead of clicking on Login button. But when they hit <ENTER> an...
    5. Textbox, button and Enter on keyboard
      Question (using C# and ASP.NET), I have a textbox and a buttonClick on my asp.net page. I would like be able to hit the Enter button on the...
  3. #2

    Default Re: How to control enter button on the client PC in ASP.Net

    You can intercept the client side enter keypress event of the text box and
    then click the correct button using javascript code.
    Here's a good example:
    [url]http://www.kamp-hansen.dk/pages/showdoc.asp?id=28&menuid=21&menuid=18[/url]

    You could also try using this free control.
    [url]http://www.metabuilders.com/tools/DefaultButtons.aspx[/url]


    And here's a good article on the subject:
    [url]http://www.allasp.net/enterkey.aspx[/url]

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]


    "Simon Fainveits" <sfainveits@rtg.com.au> wrote in message
    news:025401c35fab$740c5f00$a601280a@phx.gbl...
    > Does anybody know how to control enter button on the web
    > form? It seems to if the user hits enter button at run
    > time then it fires submit button click event. I have also
    > noticed that if the page does not have a submit button
    > then the button that was first placed on the form at
    > design time is fired and I do not want that to happen. Is
    > there any way to control enter button behaviour?
    > Many thanks
    > Simon

    Steve C. Orr, MCSD Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139