Home All Groups Group Topic Archive Search About
Author
13 Apr 2005 12:40 AM
Ilyan Mishiyev
Anyone has an idea of how to make a button default in a webform? I want to
be able to press enter to use a button when page loads, whithout having to
use a mouse everytime. Couldn't find anything in msdn. Thanks in advance.

Author
13 Apr 2005 1:39 AM
Ken Cox [Microsoft MVP]
Try this?

DefaultButtons Control

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

Show quoteHide quote
"Ilyan Mishiyev" <msnewsaccountREM***@THISigmcc.com> wrote in message
news:OnxAlF8PFHA.2604@TK2MSFTNGP10.phx.gbl...
> Anyone has an idea of how to make a button default in a webform? I want to
> be able to press enter to use a button when page loads, whithout having to
> use a mouse everytime. Couldn't find anything in msdn. Thanks in advance.
>
Author
13 Apr 2005 2:14 AM
Steve C. Orr [MVP, MCSD]
In many cases a single line of code will do the trick:
Page.RegisterHiddenField("__EVENTTARGET", MyButton.ClientID)

Here's more details on the subject:
http://www.allasp.net/enterkey.aspx

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


Show quoteHide quote
"Ilyan Mishiyev" <msnewsaccountREM***@THISigmcc.com> wrote in message
news:OnxAlF8PFHA.2604@TK2MSFTNGP10.phx.gbl...
> Anyone has an idea of how to make a button default in a webform? I want to
> be able to press enter to use a button when page loads, whithout having to
> use a mouse everytime. Couldn't find anything in msdn. Thanks in advance.
>
Author
13 Apr 2005 3:34 AM
Ilyan Mishiyev
thank you,  I will try those examples

Show quoteHide quote
"Ilyan Mishiyev" <msnewsaccountREM***@THISigmcc.com> wrote in message
news:OnxAlF8PFHA.2604@TK2MSFTNGP10.phx.gbl...
> Anyone has an idea of how to make a button default in a webform? I want to
> be able to press enter to use a button when page loads, whithout having to
> use a mouse everytime. Couldn't find anything in msdn. Thanks in advance.
>