469,568 Members | 1,576 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,568 developers. It's quick & easy.

carriage return in a textbox -> click a button?

I've done this before by trapping keydown and checking for a CR, and
then clicking a particular button based on which textbox the event
happened. However, I was wondering if there's a simpler way to trap a
carriage return in a textbox, and have it click a button?

Sep 28 '07 #1
3 4293
In ASP.NET 2.0 the panel control has a new DefaultButton property.
Set this property to the ID of a button control and it will be the default
button when focus is in that panel.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"HockeyFan" <le**********@gmail.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
I've done this before by trapping keydown and checking for a CR, and
then clicking a particular button based on which textbox the event
happened. However, I was wondering if there's a simpler way to trap a
carriage return in a textbox, and have it click a button?
Sep 28 '07 #2
Does this mean that the default button gets clicked when a carriage
return is pressed inside a textbox?
On Sep 28, 10:09 am, "Steve C. Orr [MCSD, MVP, CSM, ASP Insider]"
<St...@Orr.netwrote:
In ASP.NET 2.0 the panel control has a new DefaultButton property.
Set this property to the ID of a button control and it will be the default
button when focus is in that panel.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsiderhttp://SteveOrr.net

"HockeyFan" <les.stock...@gmail.comwrote in message

news:11**********************@k79g2000hse.googlegr oups.com...
I've done this before by trapping keydown and checking for a CR, and
then clicking a particular button based on which textbox the event
happened. However, I was wondering if there's a simpler way to trap a
carriage return in a textbox, and have it click a button?- Hide quoted text -

- Show quoted text -

Sep 28 '07 #3
Yes.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"HockeyFan" <le**********@gmail.comwrote in message
news:11**********************@w3g2000hsg.googlegro ups.com...
Does this mean that the default button gets clicked when a carriage
return is pressed inside a textbox?
On Sep 28, 10:09 am, "Steve C. Orr [MCSD, MVP, CSM, ASP Insider]"
<St...@Orr.netwrote:
>In ASP.NET 2.0 the panel control has a new DefaultButton property.
Set this property to the ID of a button control and it will be the
default
button when focus is in that panel.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsiderhttp://SteveOrr.net

"HockeyFan" <les.stock...@gmail.comwrote in message

news:11**********************@k79g2000hse.googleg roups.com...
I've done this before by trapping keydown and checking for a CR, and
then clicking a particular button based on which textbox the event
happened. However, I was wondering if there's a simpler way to trap a
carriage return in a textbox, and have it click a button?- Hide quoted
text -

- Show quoted text -

Sep 28 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Rulle | last post: by
2 posts views Thread by Abhi | last post: by
1 post views Thread by VMI | last post: by
7 posts views Thread by Nathan | last post: by
2 posts views Thread by senfo | last post: by
2 posts views Thread by dancer | last post: by
11 posts views Thread by evenlater | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.