ArrayList aList = new ArrayList();
protected void Button1_Click(object sender, EventArgs e)
{
aList.Add(DropDownList1.SelectedValue);
ListBox1.DataSource = aList;
ListBox1.DataBind();
}
This above code only binding the last inserted data into the array list.
The previously added data in the list is not displayed.
How to keep the items in the list being showed?
List<T>instead ofArrayList).List<T>toArrayList.