1 2 Protected Sub setFieldFocus(ByVal ctrl As System.Web.UI.Control) 3 Dim s As String = "<SCRIPT language='javascript'>document.getElementById('" + ctrl.ClientID + "').focus() </SCRIPT>" 4 ClientScript.RegisterStartupScript(Me.GetType, "focus", s) 5 End Sub 6 7 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 8 If Not Page.IsPostBack Then 9 BindData() 10 End If 11 setFieldFocus(txtSpecies) 12 End Sub
You need to create an account or log in to post comments to this site.