2

我有一个 ListView 和 DropDownList(primary) 以及更多和一个文本框,在该 ListView 的每一行内。全部在一个用户控件上,并在另一个用户控件上使用这个用户控件(这里是要执行的操作。)(我们正在使用 DNN)。现在我想为下拉列表添加事件处理程序,它将对 SelectedIndexChanged 做出反应。我想根据所选 DropDrownList(primary) 的特定值显示和隐藏其他下拉列表和文本框。我无处可做……尽管尝试了几次。

筛选结果:  评论:使用的子集: 焦油状态: 

后面的代码是这样的

Public Sub ddlFindingsScreeningOutcome_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Dim ddl As DropDownList = CType(sender, DropDownList)

        Dim item As ListViewItem = CType(ddl.NamingContainer, ListViewItem)

        Dim txtFindingsComments As TextBox = CType(item.FindControl("txtFindingsComments"), TextBox)
        Dim ddlFindingsTarStatus As DropDownList = CType(item.FindControl("ddlFindingsTarStatus"), DropDownList)

        If Not ddl Is Nothing Then
            If Not ddl.SelectedItem.Text = "Not Screened" Then
                txtFindingsComments.Visible = True
                ddlFindingsTarStatus.Visible = True

            End If
        Else
            txtFindingsComments.Visible = False
            ddlFindingsTarStatus.Visible = False
        End If


    End Sub
4

0 回答 0