I know I can loop through a checkboxlist.Items
and see if none of them is selected, but is there a better way to find out if no items have been selected, in the code behind?
You have to check the SelectedIndex. If it equals -1, its means nothing is selected.
CheckBoxList list = new CheckBoxList();
if (list.SelectedIndex == -1)
{
//Nothing is selected
}