I am trying to move listbox items between two listboxes.Before that i created two arrraylists for each listbox.so before moving the listbox item i am trying to add the items to the arraylist. here is the code
foreach (string st in listbox1.Items)
{
arraylist1.Add(st1);
}
but i am getting an exeption Unable to cast object of type ‘System.Web.UI.WebControls.ListItem’ to type ‘System.String’.
foreach (string st in listbox1.Items)should be