Hello, Need some assitance here with coding<BR>What I&#039;m doing is creating a collection of contols in a web form. I have an object containing FormId, ControlId and Contol Value. I&#039;m building an arraylist objects, returning the array list and I want to iterate through the Arraylist and get at the contents of the Object<BR> <BR>My problem is how in the world do I access each element from the object in the arraylist?<BR>here&#039;s the code I was working on? To test I can bind it to the data grid, but I want to basically search for a particualar element and programatically set the properties of my contols (buttons, label etc)<BR> <BR>SEE COMMENTS<BR> <BR> <BR>Test.aspx<BR> <BR>Public Sub test()<BR> Dim frmName = "Form1"<BR> Dim MyCollection As New CollectControls()<BR> Dim aControlArrayList As ArrayList<BR> Dim cControl As Control = Me.FindControl(frmName)<BR> aControlArrayList = MyCollection.LoopingControls(cControl) &#039;in CollectControls.vb<BR> Dim i As Integer<BR><BR> &#039;get first control name in arraylist<BR> &#039;find that control name in the datasetarraylist<BR> &#039;if found sent ot enable<BR> &#039;if not found disable it!<BR><BR> For i = 0 To aControlArrayList.Count - 1<BR> &#039;LOOPING THROUGH THE ARRAY HOW DO I GET AT ANY/ALL CONTENTS OF THE OBJECT?<BR><BR> &#039; If (aControlArrayList.Item(i) = "btnAdd") Then<BR> &#039; btnAdd.Enabled = True<BR> &#039; Else<BR> &#039; btnAdd.Enabled = False<BR> &#039; End If<BR><BR> Next<BR><BR> &#039;test bind to data grid<BR> DataGrid1.DataSource = aControlArrayList<BR> DataGrid1.DataBind()<BR> End Sub<BR><BR> <BR><BR>CollectControls.vb<BR><BR>Public Class CollectControls<BR><BR> Public Function LoopingControls(ByVal oControl As Control)<BR> &#039;THIS SEEMS TO WORK<BR> &#039;Dim frmname = "Form1"<BR> &#039;Dim oControl As Control = FindControl(frmname)<BR> Dim cControl As Control<BR> Dim aArrayList = New ArrayList()<BR><BR> Dim cTextbox As TextBox<BR> Dim cLabel As Label<BR> Dim cButton As Button<BR><BR> For Each cControl In oControl.Controls<BR><BR> If TypeOf cControl Is TextBox Then<BR> cTextbox = CType(cControl, TextBox)<BR> aArrayList.Add(New ControlUtility(oControl.ID, cTextbox.ID, cTextbox.Text)) <BR><BR> ElseIf TypeOf cControl Is Label Then<BR> cLabel = CType(cControl, Label)<BR> aArrayList.Add(New ControlUtility(oControl.ID, cLabel.ID, cLabel.Text))<BR><BR> ElseIf TypeOf cControl Is Button Then<BR> cButton = CType(cControl, Button)<BR> aArrayList.Add(New ControlUtility(oControl.ID, cButton.ID, cButton.Text))<BR> End If<BR> Next<BR> Return aArrayList &#039;return array list back to form<BR> End Function<BR><BR>End Class<BR><BR> <BR><BR>ControlCollectionUtility.VB<BR><BR>Publi c Class ControlUtility<BR> Private _formid As String<BR> Private _controlid As String<BR> Private _controlvalue As String<BR> Public Sub New(ByVal FormID As String, ByVal ControlId As String, ByVal ControlValue As String)<BR> _formid = FormID<BR> _controlid = ControlId<BR> _controlvalue = ControlValue<BR> End Sub<BR> Public Property FormID() As String<BR> Get<BR> Return _formid<BR> End Get<BR> Set(ByVal Value As String)<BR> _formid = FormID<BR> End Set<BR> End Property<BR><BR> Public Property ControlId() As String<BR> Get<BR> Return (_controlid)<BR> End Get<BR> Set(ByVal ControlId As String)<BR> _controlid = ControlId<BR> End Set<BR> End Property<BR><BR> Public Property ControlValue() As String<BR> Get<BR> Return (_controlvalue)<BR> End Get<BR> Set(ByVal Value As String)<BR> _controlvalue = ControlValue<BR> End Set<BR> End Property<BR>End Class<BR><BR> <BR><BR>thanks in advance<BR><BR>B<BR><BR> <BR> <BR>