Why are the unchecked checkboxes not in the collection? I can only access the values from the checked ones.
I need it because i want to delete all unchecked from my DB.
Here a code sample:
foreach (var item in collection.AllKeys.Where(c => c.StartsWith("check_projekt_")).Select((x, i) => new { Data = x, Index = i }))
{
if (collection[item.Data] == "1")
{
dbclass.addUserToProjekt(Convert.ToInt32(collection["projekt_" + item.Index]), Convert.ToDouble(collection["input_projekt_" + item.Index]), mID);
}
else {
dbclass.deleteUserFromProjekt(Convert.ToInt32(collection["projekt_" + item.Index]), mID);
}
}
TIA