Choosing a default button

Discussion in 'ASP .Net' started by Ford Desperado, Sep 27, 2004.

  1. Hi,

    I have a ASP.Net page with several asp:textbox controls and 3
    asp:button's
    I want to specify 1 of these buttons as the default one, so that
    whenever a user presses 'Enter' while a textbox is selected, the
    handler for the default button is invoked

    TIA
    Ford
     
    Ford Desperado, Sep 27, 2004
    #1
    1. Advertising

  2. Ford Desperado

    Greg Burns Guest

    http://www.metabuilders.com/Tools/DefaultButtons.aspx

    Greg

    "Ford Desperado" <> wrote in message
    news:...
    > Hi,
    >
    > I have a ASP.Net page with several asp:textbox controls and 3
    > asp:button's
    > I want to specify 1 of these buttons as the default one, so that
    > whenever a user presses 'Enter' while a textbox is selected, the
    > handler for the default button is invoked
    >
    > TIA
    > Ford
     
    Greg Burns, Sep 27, 2004
    #2
    1. Advertising

  3. You can intercept the client side enter keypress event of the text box and
    then do what you want using javascript code.
    Here's a good example:
    http://www.kamp-hansen.dk/pages/showdoc.asp?id=28&menuid=21&menuid=18

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

    And here's a couple good articles on the subject:
    http://www.allasp.net/enterkey.aspx
    http://www.aspnetpro.com/features/2004/06/asp200406so_f/asp200406so_f.asp

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://Steve.Orr.net


    "Ford Desperado" <> wrote in message
    news:...
    > Hi,
    >
    > I have a ASP.Net page with several asp:textbox controls and 3
    > asp:button's
    > I want to specify 1 of these buttons as the default one, so that
    > whenever a user presses 'Enter' while a textbox is selected, the
    > handler for the default button is invoked
    >
    > TIA
    > Ford
     
    Steve C. Orr [MVP, MCSD], Sep 27, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Crowe
    Replies:
    2
    Views:
    16,274
    Jukka K. Korpela
    Feb 6, 2004
  2. Bjorn Sagbakken

    Choosing whitch button will act as submit button

    Bjorn Sagbakken, Dec 10, 2006, in forum: ASP .Net
    Replies:
    7
    Views:
    377
    Bjorn Sagbakken
    Dec 12, 2006
  3. AlecL
    Replies:
    2
    Views:
    824
    Alexey Smirnov
    Feb 12, 2007
  4. Replies:
    2
    Views:
    149
    Bullschmidt
    Aug 13, 2005
  5. Replies:
    0
    Views:
    88
Loading...

Share This Page