Set Focus of Controls in ASP.NET

Posted by Santosh4u under ASP.NET category on | Views : 2211
Refer Below Code to Set the Focus of a Control in
you need to call this method where you want to set focus of control.
  Private Sub SetFocus(ByVal FocusControl As Control)
Dim Script As New System.Text.StringBuilder
Dim ClientID As String = FocusControl.ClientID
With Script
.Append("<script language='javascript'>")
End With
RegisterStartupScript("setFocus", Script.ToString())
End Sub


Comments or Responses

Login to post response