这样写对马?为什么没有移除 
        foreach (ListItem item in ListBox1.Items)
        {
            if (item.Selected == true)
            {
               string  ItemValue = item.Value;
               ListBox1.Items.Remove(item.Value);
            }
        }
        ListBox1.DataBind();

解决方案 »

  1.   

    在这里使用 if  不要用 foreach
      

  2.   

    for (int i = listbox1.Items.Count - 1; i >= 0; i++)
    {
    if ....
    listbox1.Items.RemoveAt(i)
    ....
    }
      

  3.   

    sorry,use for loop ,not if judge
      

  4.   

    LZ这样有两问题:
    1、使用Foreach时不能修改枚举内容,改成for就可以了。
    2、DataBind会再次把数据源中的数据填充到ListItem里,你必然看不到Item移除。