Which event?

Discussion in 'ASP .Net' started by Steve Schroeder, Apr 5, 2005.

  1. I have a working form/datagrid/search page working...was trying allow the
    user to enter search criteria in a textbox, hit enter, and fire off the same
    event my command button runs.

    How might I do that? There doesn't seem to be an obvious event tied to the
    textbox or form that this would go.

    Thanks,

    Steve
    Steve Schroeder, Apr 5, 2005
    #1
    1. Advertising

  2. Steve Schroeder

    Teemu Keiski Guest

    If you mean that hitting Enter would cause anything to happen even if you
    have a Button on the form also, that's a known problem. You can work around
    it with this control, for example

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

    If you want to get to the "event", you'd need to wire event for say
    onkeypress client-side event, check if the keyCode is 13 (enter, how you get
    to this in various browsers might indeed vary) and then cause client-side
    action (postback) that again causes something to happen at server.

    --
    Teemu Keiski
    ASP.NET MVP, AspInsider
    Finland, EU


    "Steve Schroeder" <> wrote in message
    news:...
    >I have a working form/datagrid/search page working...was trying allow the
    > user to enter search criteria in a textbox, hit enter, and fire off the
    > same
    > event my command button runs.
    >
    > How might I do that? There doesn't seem to be an obvious event tied to the
    > textbox or form that this would go.
    >
    > Thanks,
    >
    > Steve
    >
    >
    >
    Teemu Keiski, Apr 5, 2005
    #2
    1. Advertising

  3. Thanks, appreciate the pointer.

    Did someone at MS have a brain fart over this one...hello...anyone home at
    Redmond...lol, amazing.

    "Teemu Keiski" <> wrote in message
    news:%...
    > If you mean that hitting Enter would cause anything to happen even if you
    > have a Button on the form also, that's a known problem. You can work

    around
    > it with this control, for example
    >
    > http://www.metabuilders.com/Tools/DefaultButtons.aspx
    >
    > If you want to get to the "event", you'd need to wire event for say
    > onkeypress client-side event, check if the keyCode is 13 (enter, how you

    get
    > to this in various browsers might indeed vary) and then cause client-side
    > action (postback) that again causes something to happen at server.
    >
    > --
    > Teemu Keiski
    > ASP.NET MVP, AspInsider
    > Finland, EU
    >
    >
    > "Steve Schroeder" <> wrote in message
    > news:...
    > >I have a working form/datagrid/search page working...was trying allow the
    > > user to enter search criteria in a textbox, hit enter, and fire off the
    > > same
    > > event my command button runs.
    > >
    > > How might I do that? There doesn't seem to be an obvious event tied to

    the
    > > textbox or form that this would go.
    > >
    > > Thanks,
    > >
    > > Steve
    > >
    > >
    > >

    >
    >
    Steve Schroeder, Apr 5, 2005
    #3
  4. I can add the Metabuilder's DefaultButtons as a reference to my project, but
    I when I go to add it to my toolbox...I get...dll cannot be loaded, check
    that dependencies are installed...

    I had this same problem with another third party control, .DotNetCharting.
    So much for the end of DLL hell...lol.

    Billy, Billy, Billy...what were you thinking?

    "Teemu Keiski" <> wrote in message
    news:%...
    > If you mean that hitting Enter would cause anything to happen even if you
    > have a Button on the form also, that's a known problem. You can work

    around
    > it with this control, for example
    >
    > http://www.metabuilders.com/Tools/DefaultButtons.aspx
    >
    > If you want to get to the "event", you'd need to wire event for say
    > onkeypress client-side event, check if the keyCode is 13 (enter, how you

    get
    > to this in various browsers might indeed vary) and then cause client-side
    > action (postback) that again causes something to happen at server.
    >
    > --
    > Teemu Keiski
    > ASP.NET MVP, AspInsider
    > Finland, EU
    >
    >
    > "Steve Schroeder" <> wrote in message
    > news:...
    > >I have a working form/datagrid/search page working...was trying allow the
    > > user to enter search criteria in a textbox, hit enter, and fire off the
    > > same
    > > event my command button runs.
    > >
    > > How might I do that? There doesn't seem to be an obvious event tied to

    the
    > > textbox or form that this would go.
    > >
    > > Thanks,
    > >
    > > Steve
    > >
    > >
    > >

    >
    >
    Steve Schroeder, Apr 5, 2005
    #4
    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. John
    Replies:
    0
    Views:
    358
  2. Nathan Sokalski
    Replies:
    4
    Views:
    4,158
    Nathan Sokalski
    Mar 11, 2006
  3. Familyman
    Replies:
    3
    Views:
    519
    Alan J. Flavell
    Feb 9, 2006
  4. Nathan Sokalski

    Determining the Browser and event.keyCode vs. event.which

    Nathan Sokalski, Mar 10, 2006, in forum: ASP .Net Building Controls
    Replies:
    4
    Views:
    172
    Nathan Sokalski
    Mar 11, 2006
  5. Sunny Mohan
    Replies:
    0
    Views:
    208
    Sunny Mohan
    Apr 5, 2004
Loading...

Share This Page