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 / Web Controls / November 2005

Tip: Looking for answers? Try searching our database.

Setting focus to TextBox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Simon Cheng - 26 Nov 2005 05:14 GMT
Hi,,

Is there a way to set focus to an System.Web.UI.WebControls.TextBox control
on a web form? The class doesn't seem to provide such facility? Basically I
want to set input cursor to a TextBox when the page is first loaded or after
the user submit invalid data.

Thanks,
- Simon
Steve C. Orr [MVP, MCSD] - 27 Nov 2005 01:41 GMT
You can set focus to a particular control with the Javascript "focus"
method.

In ASP.NET 2.0 its even easier.

Here are all the details:
http://SteveOrr.net/faq/2in1.aspx

Signature

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

> Hi,,
>
[quoted text clipped - 5 lines]
> Thanks,
> - Simon
Simon Cheng - 27 Nov 2005 22:17 GMT
Thanks! ASP.NET 2.0's DefaultButton only supports (well) Button control. Is
there an equivalent for TextBox control?

-Simon

> You can set focus to a particular control with the Javascript "focus"
> method.
[quoted text clipped - 13 lines]
>> Thanks,
>> - Simon

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.