Add objects to ArrayList (C#) : ArrayList « Collections « ASP.NET Tutorial






<%@ Page Language="C#" %>
<script runat="server">

private void Page_Load(object sender, System.EventArgs e)
{
  System.Collections.ArrayList al = new System.Collections.ArrayList(5);
  
  al.Add("one");
  al.Add(2);
  al.Add(false);
  al.Add(new System.Object());
  
  Response.Write("Successfully added " + al.Count + " different types of objects to an ArrayList.");
}
</script>








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