Yesterday whilst creating an ASP.NET application I needed to find the selected items in a ListBox with SelectionMode=”Multiple” property set, unfortunately I found that ASP.NET (and VB.NET) doesn’t support the SelectedItems property it only has SelectedItem! How annoying! Especailly since it is avaliable in WinForms!
Anyway thought I’d share my simple workaround in case anyone else has similar issues…
ArrayList selectedItems = new ArrayList();
foreach(ListItem i in ListBox1.Items)
if(i.Selected == true)