How to find the selected items in ListBox with Linq without using foreach loop

Goldytech
Posted by Goldytech under LINQ category on | Views : 11876
var SelectedItems = (from ListItem li in ListBox1.Items
where li.Selected == true
select li.Text).ToList();
List<string> selectedStates = (List<string>)SelectedItems;

Comments or Responses

Login to post response