T
Tapi
Hello there,
I am new to ASP .NET and am tryimg to create a RadioButtonList dynamically.
My code below gives an "Index was out of range" error.
Where am I going wrong?
Sub CreateRadioButtons(ByVal dr)
' Instantiate RadioButtonList
Dim DynamicRadioButtonList As New RadioButtonList
Dim t As Integer
t = 0
Do While dr.Read()
DynamicRadioButtonList.Items(t).Text = dr("PRO_en")
t = t + 1
Loop
'Add radio button
PlaceHolderGroup.Controls.Add(DynamicRadioButtonList)
End Sub
Thank you for your help
I am new to ASP .NET and am tryimg to create a RadioButtonList dynamically.
My code below gives an "Index was out of range" error.
Where am I going wrong?
Sub CreateRadioButtons(ByVal dr)
' Instantiate RadioButtonList
Dim DynamicRadioButtonList As New RadioButtonList
Dim t As Integer
t = 0
Do While dr.Read()
DynamicRadioButtonList.Items(t).Text = dr("PRO_en")
t = t + 1
Loop
'Add radio button
PlaceHolderGroup.Controls.Add(DynamicRadioButtonList)
End Sub
Thank you for your help