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, it is always going to the else statement. this is my code:
if radiobuttonlist1.selectedindex > -1
else
Dim rl1 As RadioButtonList = New RadioButtonList() If rbl1.SelectedIndex > -1 Label2.Text = "Checked" Else Label2.Text = "Not Checked" End If
You declared your var wrong:
Dim rl1 As Radio Button List = New Radio Button List()
should be:
Dim rl1 As RadioButtonList = New RadioButtonList()
1.4m articles
1.4m replys
5 comments
57.0k users