Foreach loop (VB) : ArrayList « Collections « ASP.NET Tutorial






<%@ Page %>
<script language="vb" runat="server">
  Sub Page_Load(sender As Object, e As EventArgs)
    Dim i As Integer
    Dim item As String
    Dim myList As New System.Collections.ArrayList()
    myList.Add("Zero")
    myList.Add("One")
    myList.Add("Two")
    myList.Add("Three")
    myList.Add("Four")
    myList.Add("Five")

    For Each item In myList
      Response.Write(Item & "<BR>")
    Next
  End Sub
</script>
<html>
  <body>
    <form id="form1" method="post" runat="server">
    </form>
  </body>
</html>








7.2.ArrayList
7.2.1.Add objects to ArrayList (C#)
7.2.2.Add objects to ArrayList (VB)
7.2.3.Foreach loop (C#)
7.2.4.Foreach loop (VB)
7.2.5.Using an ArrayList instead of an array (C#)
7.2.6.Using an ArrayList instead of an array (VB)
7.2.7.Using a custom strongly typed PersonList (C#)
7.2.8.Using a custom strongly typed PersonList (VB)
7.2.9.ArrayList with custom objects
7.2.10.Bind ArrayList to DropDownList