Put this code in SignIn.vb
'set focus to any control
'Snapsis - Copied function here to support versions prior to 1.0.10
Private Sub SetFormFocus(ByVal control As Control)
If Not control.Page Is Nothing Then
If control.Page.Request.Browser.JavaScript = True Then
' Create JavaScript
Dim sb As New System.Text.StringBuilder()
sb.Append("<SCRIPTLANGUAGE='JavaScript'>")
sb.Append("<!--")
sb.Append(ControlChars.Lf)
sb.Append("function SetInitialFocus() {")
sb.Append(ControlChars.Lf)
sb.Append(" document.")
' Find the Form
Dim objParent As control = control.Parent
While Not TypeOf objParent Is System.Web.UI.HtmlControls.HtmlForm
objParent = objParent.Parent
End While
sb.Append(objParent.ClientID)
sb.Append("['")
sb.Append(control.UniqueID)
sb.Append("'].focus(); }")
sb.Append("window.onload = SetInitialFocus;")
sb.Append(ControlChars.Lf)
sb.Append("// -->")
sb.Append(ControlChars.Lf)
sb.Append("</SCRIPT>")
' Register Client Script
control.Page.RegisterClientScriptBlock("InitialFocus", sb.ToString())
End If
End If
End Sub |