I have a dataListItem with a checkbox and I need to check and make sure at least one checkbox is checked, how do I loop through and check for checkboxes that are
checked?
The if statement only execute if ALL checkBoxes are not checked. If one checkbox is checked everything is okay, but if all are false flag the user.
Code
foreach (DataListItem xCName in ddlCompanyName.Items)
{
CheckBox ckBxCustomer = (CheckBox)xCName.FindControl("ckBxCustomer");
if ((ckBxCustomer.Checked == false))
{
// if NOT checked action goes here. Please help me with the best solution for looping through a DataListItem.
Go to the complete details ...