Home All Groups Group Topic Archive Search About
Author
29 Mar 2005 4:34 PM
Randel Bjorkquist
I'm trying to figure out how to stop one of the Button on my WebForm, from
activating its OnClick event when I press the "Enter" key while entering
data in a TextBox.  If I disable it, the control/focus goes to another
Button and that Button then has the same thing happen.

I know there must be a way of not allowing this.  I just haven't found it.
Can anyone help me?

Thanks,

Randel Bjorkquist

Author
29 Mar 2005 5:59 PM
Steve C. Orr [MVP, MCSD]
I agree the default behavior is less than intuitive and sometimes quite
annoying.

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

If you prefer a more manual approach, here are 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


Show quoteHide quote
"Randel Bjorkquist" <rbjorkqu***@coilcraft.com> wrote in message
news:u9RI80HNFHA.592@TK2MSFTNGP10.phx.gbl...
> I'm trying to figure out how to stop one of the Button on my WebForm, from
> activating its OnClick event when I press the "Enter" key while entering
> data in a TextBox.  If I disable it, the control/focus goes to another
> Button and that Button then has the same thing happen.
>
> I know there must be a way of not allowing this.  I just haven't found it.
> Can anyone help me?
>
> Thanks,
>
> Randel Bjorkquist
>
Author
29 Mar 2005 6:51 PM
Randel Bjorkquist
Hey Steve,

Thanks for all the information.

Randel

Show quoteHide quote
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:ebcJZkINFHA.508@TK2MSFTNGP12.phx.gbl...
>I agree the default behavior is less than intuitive and sometimes quite
>annoying.
>
> You could use this free control to solve the problem.
> http://www.metabuilders.com/tools/DefaultButtons.aspx
>
> If you prefer a more manual approach, here are 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
>
>
> "Randel Bjorkquist" <rbjorkqu***@coilcraft.com> wrote in message
> news:u9RI80HNFHA.592@TK2MSFTNGP10.phx.gbl...
>> I'm trying to figure out how to stop one of the Button on my WebForm,
>> from activating its OnClick event when I press the "Enter" key while
>> entering data in a TextBox.  If I disable it, the control/focus goes to
>> another Button and that Button then has the same thing happen.
>>
>> I know there must be a way of not allowing this.  I just haven't found
>> it. Can anyone help me?
>>
>> Thanks,
>>
>> Randel Bjorkquist
>>
>
>