【发布时间】:2011-09-27 20:18:53
【问题描述】:
我正在尝试在两个列表框之间移动列表框项目。在此之前,我为每个列表框创建了两个数组列表。因此,在移动列表框项目之前,我尝试将这些项目添加到数组列表中。这是代码
foreach (string st in listbox1.Items)
{
arraylist1.Add(st1);
}
但我遇到了一个异常,无法将“System.Web.UI.WebControls.ListItem”类型的对象转换为“System.String”类型。
【问题讨论】: