I dynamically create a checkbox list. I then want to get the values of the checkboxes that are ticked.
In this example it would put the text values into a textbox (I will be doing more but to get proof of concept this is ideal for testing)
I think I am close...
The error line is - "Object reference not set to an instance of an object." on line " If CheckBoxList1.Items.FindByValue(i).Selected = True Then"
Dim i As Integer = 0
Dim vValue As String = "test"
For Each item As ListItem In CheckBoxList1.Items
If item.Selected Then
i += 1
If CheckBoxList1.Items.FindByValue(i).Selected = True Then
'#### Do things here
' txt.Text = txt.Text & Checkbox value
End If
End If
Next
Go to the complete details ...