Show hide div using codebehind

前端 未结 8 2069
难免孤独
难免孤独 2020-12-30 00:29

I have a DropDownList for which I am trying to show a div OnSelectedIndexChanged but it says OBJECT REQUIRED.

I a

8条回答
  •  情书的邮戳
    2020-12-30 01:19

    
    

    vb.net code

      Protected Sub DropDownList1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DropDownList1.SelectedIndexChanged
        If DropDownList1.SelectedIndex = 0 Then
            OK1.Style.Add("display", "none")
        Else
            OK1.Style.Add("display", "block")
        End If
    End Sub
    

提交回复
热议问题