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 CreateRadioButt ons(ByVal dr)
' Instantiate RadioButtonList
Dim DynamicRadioBut tonList As New RadioButtonList
Dim t As Integer
t = 0
Do While dr.Read()
DynamicRadioBut tonList.Items(t ).Text = dr("PRO_en")
t = t + 1
Loop
'Add radio button
PlaceHolderGrou p.Controls.Add( DynamicRadioBut tonList)
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 CreateRadioButt ons(ByVal dr)
' Instantiate RadioButtonList
Dim DynamicRadioBut tonList As New RadioButtonList
Dim t As Integer
t = 0
Do While dr.Read()
DynamicRadioBut tonList.Items(t ).Text = dr("PRO_en")
t = t + 1
Loop
'Add radio button
PlaceHolderGrou p.Controls.Add( DynamicRadioBut tonList)
End Sub
Thank you for your help
Comment