Set Focus

G

Guest

Does anyone have any idea how to set focus on any control inside of a user
control?

Any help appreciated.

Leon
 
S

Scott Mitchell [MVP]

Leon said:
Does anyone have any idea how to set focus on any control inside of a user
control?

Leon, you can use Andy Smith's FirstFocus control
[http://metabuilders.com/Tools/FirstFocus.aspx], or read up on how to do
it yourself, through server-side code, in my article:

Working with Client-Side Script
http://tinyurl.com/3w474

Essentially you need to get the ID from the control you want to set
focus to using the control's ClientID property, and then a small bit of
client-side JavaScript is needed to put focus on that control.

Happy Programming!

--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,241
Latest member
Lisa1997

Latest Threads

Top