ARTICLE
How to set Focus on Web Server Controls in ASP.NET
This article shows you, how we can set the focus of any Web Server Control in ASP.NET.
We can set the focus on a specific Web Server Control by using server code. For that we can call the control's Focus method on the Page_Load or in any Page Event, as per the requirement.
In the following example, we set the focus of the TextBox on the Page_Load.
Protected Sub Page_Load(ByVal sender As Object, _
ByVal e As System.EventArgs)
textBox.Focus()
End Sub