From Checkbox to Linq list
Just the Values of the Selected Items
List<string> selectedValues = chkMyList.Items.Cast<ListItem>()
.Where(li => li.Selected)
.Select(li => li.Value)
.ToList();
Both Text and Value of Selected item into a listItem object
List<ListItem> selected = chkMyList.Items.Cast<ListItem>()
.Where(li => li.Selected)
.ToList();
Comments