How can I check if a radio button inside a radio button list is checked?
I used if radiobuttonlist1.selectedindex > -1 and then I checked a radio button, but it is not reading the selected radio button, it is always going to the else statement.
this is my code:
Dim rl1 As RadioButtonList = New RadioButtonList() If rbl1.SelectedIndex > -1 Label2.Text = "Checked" Else Label2.Text = "Not Checked" End If
You can do this.
Go to your RadioButton_CheckedChanged event and add this code
RadioButton_CheckedChanged
If RadioButton1.Checked = True Then Me.Label1.Text = "Checked" Else Me.Label1.Text = "UnChecked" End If
1.4m articles
1.4m replys
5 comments
57.0k users