c# loop through repeater items

C#
foreach (RepeaterItem item in repeater.Items)
{
    if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
    {
        CheckBox chk = (CheckBox)item.FindControl("ckbActive");

        bool r = chk.Checked;
    }
}
Source

Also in C#: