Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

carriage return in a textbox -> click a button?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
HockeyFan - 28 Sep 2007 15:50 GMT
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?
Steve C. Orr [MCSD, MVP, CSM, ASP Insider] - 28 Sep 2007 16:09 GMT
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.

Signature

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

> 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?
HockeyFan - 28 Sep 2007 16:22 GMT
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.net> wrote:
> 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
[quoted text clipped - 11 lines]
>
> - Show quoted text -
Steve C. Orr [MCSD, MVP, CSM, ASP Insider] - 29 Sep 2007 00:09 GMT
Yes.

Signature

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

> Does this mean that the default button gets clicked when a carriage
> return is pressed inside a textbox?
[quoted text clipped - 18 lines]
>>
>> - Show quoted text -

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.