How To Set Default Focus To a Server Control

ASP.NET 2.0

You can easily set the focus to a specific control when your web form is loaded, by adding the line

Page.SetFocus(<ControlID>);

to your Page_Load() event.

Leave a Reply

You must be logged in to post a comment.