Control arrays or collections on Web Forms

  • Thread starter Thread starter Fred
  • Start date Start date
F

Fred

I have items that are variable in number that I wish to display on a web
form. And I would like to be able to specify or access the contents of
item(x) by referenced the x elements of that array/collection.

I have tried something like the following on the form load event but though
I receive no build errors nothing ever shows on the form.

Dim ArrLabel(10) As WebControls.Label
For x = 1 To 10
ArrLabel(x) = New WebControls.Label
ArrLabel(x).Visible = True
ArrLabel(x).Text = "Label "
Page.Controls.Add(ArrLabel(x))
Next


Any help or guidance is appreciated.

Fred
 
I don't think there is something call control array in VB.NET. You didn't
mention what result your code got.

chanmm
 
Back
Top