Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Set Focus

Reply
Thread Tools

Set Focus

 
 
=?Utf-8?B?TGVvbg==?=
Guest
Posts: n/a
 
      11-15-2004
Does anyone have any idea how to set focus on any control inside of a user
control?

Any help appreciated.

Leon
 
Reply With Quote
 
 
 
 
Scott Mitchell [MVP]
Guest
Posts: n/a
 
      11-15-2004
Leon wrote:
> 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

http://www.4GuysFromRolla.com

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

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
this.window.focus() vs. window.focus() vs. this.focus() Roger Javascript 3 03-08-2007 08:53 PM
Why does putting focus on textbox also set focus to submit jw56578@gmail.com Javascript 2 06-06-2005 08:20 PM
Pan Focus vs Auto Focus JethroUK© Digital Photography 2 08-11-2004 06:26 PM
any manual focus cameras easy to focus? Catherine Jo Morgan Digital Photography 6 11-05-2003 06:36 PM
Unable to set focus to textfield in a applet if browser is set to Sun JRE 1.4 Manav Java 0 10-15-2003 03:42 PM



Advertisments