Proper postback when Enter Key is pressed

Discussion in 'ASP .Net' started by Jim in Arizona, Aug 18, 2006.

  1. I have a simple vb aspx page with a single text control and button
    control. The user puts a date in the text field and pressed the button
    and a gridview is filled with data. If I put in a date and just hit
    enter, it looks like the page is posting back but nothing happens. I
    don't know how to set the page to where if the user hits enter on the
    keyboard, it is the same as clicking the button.

    TIA,
    Jim
    Jim in Arizona, Aug 18, 2006
    #1
    1. Advertising

  2. Jim in Arizona

    Kumar Reddi Guest

    See this post
    http://kumarr.net/blog/articles/11.aspx

    Jim in Arizona wrote:
    > I have a simple vb aspx page with a single text control and button
    > control. The user puts a date in the text field and pressed the button
    > and a gridview is filled with data. If I put in a date and just hit
    > enter, it looks like the page is posting back but nothing happens. I
    > don't know how to set the page to where if the user hits enter on the
    > keyboard, it is the same as clicking the button.
    >
    > TIA,
    > Jim
    Kumar Reddi, Aug 18, 2006
    #2
    1. Advertising

  3. You could use this free control to solve the problem.
    http://www.metabuilders.com/tools/DefaultButtons.aspx

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

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


    "Jim in Arizona" <> wrote in message
    news:...
    >I have a simple vb aspx page with a single text control and button control.
    >The user puts a date in the text field and pressed the button and a
    >gridview is filled with data. If I put in a date and just hit enter, it
    >looks like the page is posting back but nothing happens. I don't know how
    >to set the page to where if the user hits enter on the keyboard, it is the
    >same as clicking the button.
    >
    > TIA,
    > Jim
    Steve C. Orr [MVP, MCSD], Aug 18, 2006
    #3
  4. Jim in Arizona, Aug 18, 2006
    #4
  5. Jim in Arizona, Aug 18, 2006
    #5
    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. gh0st54
    Replies:
    2
    Views:
    7,290
    gh0st54
    Sep 27, 2004
  2. Replies:
    0
    Views:
    352
  3. =?Utf-8?B?Sm9l?=
    Replies:
    11
    Views:
    1,125
    =?Utf-8?B?Sm9l?=
    Oct 21, 2005
  4. Rune
    Replies:
    6
    Views:
    1,254
    Richie Hindle
    Jan 29, 2004
  5. BrianDH

    Enter Key H*ll, control enter key submit button

    BrianDH, Jan 12, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    388
    Anders Matthiessen
    Jan 12, 2005
Loading...

Share This Page