This is probably already known to 95% of all .NET developers, but I didn't know that you couldn't use a RequiredValidator web control with a CheckBoxList. So here's the approach I took, with thanks to a couple of quick google finds here and here.
A UserControl containing a CheckBoxList called cblServices contains the validation method and writes the error message if needed.
public bool CheckBoxListIsValid()
{
bool blnValid = false;
for(int i=0; i < cblServices.Items.Count; i++)
{
if (cblServices.Items[i].Selected)
blnValid = true;
}
return blnValid;
}
public void WriteValidationError()
{
lblInvalidCheckboxlist.Text = "Select Service(s)";
}
The submit button is located in the parent page, which performs the testing from the above usercontrol methods before proceeding onto the next process
if (!uc_mycontrol.CheckBoxListIsValid())
uc_mycontrol.WriteValidationError();
else
{ .....