818 聚焦并选中内容

来源:互联网 发布:python解释器 编辑:程序博客网 时间:2024/05/14 13:51

 

 Case "EDIT"
                MicUi.PageFocus(Me.txtExceedReason)

  Public Sub PageFocus(ByVal webControl As WebControl)
        Dim lsClientID As String = webControl.ClientID
        If TypeOf webControl Is RadioButtonList OrElse TypeOf webControl Is CheckBoxList Then
            lsClientID = String.Format("{0}_0", lsClientID)
            JsAppend(JsAppendEnum.window_onload, JsAddTry(String.Format("document.all.{0}.focus();", lsClientID), False))
        ElseIf TypeOf webControl Is DropDownList Then
            JsAppend(JsAppendEnum.window_onload, JsAddTry(String.Format("document.all.{0}.focus();", lsClientID), False))
        Else
            JsAppend(JsAppendEnum.window_onload, JsAddTry(String.Format("document.all.{0}.focus();document.all.{0}.select();", lsClientID), False))
        End If
    End Sub

原创粉丝点击