Hi All,

I have populated a listbox control with some items and I then want to remove those selected by the user:

Code:
           foreach (ListItem li in ContactList.Items)
            {
                if (li.Selected == true)
                {
                    ContactList.Items.Remove(li.Text);
                }
            }
trouble is as soon as the first item is removed code crashes because the foreach is now out of sync.

HOw can I force only those items selected to be removed