当我从第一个下拉列表中选择一个值时,它会将第二个下拉列表和文本框填充到正确的值。但是,当我从第二个下拉列表中选择不同的值时,文本框值仍保留与填充它的值相同的值。谁能指出我做错了什么?
If ds.Tables(0).Rows(0).Item(3).ToString = "M" Then
DropDownList2.Items.Insert(0, "Member")
DropDownList2.Items.Insert(1, "Non-Member")
DropDownList2.Items.Insert(2, "")
TextBox1.Text = "M"
ElseIf ds.Tables(0).Rows(0).Item(3).ToString = "NM" Then
DropDownList2.Items.Insert(0, "Non-Member")
DropDownList2.Items.Insert(1, "Member")
DropDownList2.Items.Insert(2, "")
TextBox1.Text = "NM"
Else
DropDownList2.Items.Insert(0, "")
DropDownList2.Items.Insert(1, "Member")
DropDownList2.Items.Insert(2, "Non-Member")
TextBox1.Text = ""
End If
If DropDownList2.SelectedValue = "Member" Then
TextBox1.Text = ""
TextBox1.Text = "M"
ElseIf DropDownList2.SelectedValue = "Non-Member" Then
TextBox1.Text = ""
TextBox1.Text = "NM"
Else
TextBox1.Text = ""
End If