Wrong Button.OnClick() for TextBox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lenard Gunda

    Wrong Button.OnClick() for TextBox

    Hi!

    I have an ASP.NET page with multiple TextBox fields and buttons. When I
    press the <enter> key in a TextBox, the page postbacks, and one of the
    buttons get fired (OnClick). Now certain TextBoxes trigger one particular
    button on the page (this is the first button on the page, so probably that's
    why that gets fired), while there is one TextBox, that seems to trigget
    another one. I have no idea what's the difference between the TextBoxes, why
    some fire this button and the others another..

    Is there a way to specify which TextBox triggers which Button on the <enter>
    keypress? I didn't find anything, like a default button for the form, or
    something like that. But I would like to specify a default button on a per
    control (that is, per TextBox) basis.

    Thanks

    Lenard Gunda


  • Torrent Nicolas

    #2
    Re: Wrong Button.OnClick( ) for TextBox

    Lenard Gunda a écrit :[color=blue]
    > Hi!
    >
    > I have an ASP.NET page with multiple TextBox fields and buttons. When I
    > press the <enter> key in a TextBox, the page postbacks, and one of the
    > buttons get fired (OnClick). Now certain TextBoxes trigger one particular
    > button on the page (this is the first button on the page, so probably that's
    > why that gets fired), while there is one TextBox, that seems to trigget
    > another one. I have no idea what's the difference between the TextBoxes, why
    > some fire this button and the others another..
    >
    > Is there a way to specify which TextBox triggers which Button on the <enter>
    > keypress? I didn't find anything, like a default button for the form, or
    > something like that. But I would like to specify a default button on a per
    > control (that is, per TextBox) basis.
    >
    > Thanks
    >
    > Lenard Gunda[/color]

    You can use a specific control witch allows to specify the button on
    thr action.
    Go to http://www.metabuilders.com and use the DefaultButtons

    Hope this help you

    --
    Ceci est une signature automatique de MesNews.
    Site : http://mesnews.no-ip.com

    Comment

    • avnrao

      #3
      Re: Wrong Button.OnClick( ) for TextBox

      use this Page.RegisterHi ddenField("__EV ENTTARGET",btnS earch.ClientID) ;

      but it will fire for every text box that your cursor is in and you press
      enter.

      Av.

      "Lenard Gunda" <frenzy@fbi.h u> wrote in message
      news:u$UGm$5REH A.1396@TK2MSFTN GP12.phx.gbl...[color=blue]
      > Hi!
      >
      > I have an ASP.NET page with multiple TextBox fields and buttons. When I
      > press the <enter> key in a TextBox, the page postbacks, and one of the
      > buttons get fired (OnClick). Now certain TextBoxes trigger one particular
      > button on the page (this is the first button on the page, so probably
      > that's
      > why that gets fired), while there is one TextBox, that seems to trigget
      > another one. I have no idea what's the difference between the TextBoxes,
      > why
      > some fire this button and the others another..
      >
      > Is there a way to specify which TextBox triggers which Button on the
      > <enter>
      > keypress? I didn't find anything, like a default button for the form, or
      > something like that. But I would like to specify a default button on a per
      > control (that is, per TextBox) basis.
      >
      > Thanks
      >
      > Lenard Gunda
      >
      >[/color]


      Comment

      Working...