protected void btnCities_Click(object sender, EventArgs e) { Int64 SupplierId = SuppliersSessionHelper.SupplierId(); SupplierController.DeleteAllSupplierCity(SupplierId); foreach (RepeaterItem rItem in rptCity.Items) { foreach (ListItem item in ((CheckBoxList)rItem.FindControl("cblCities")).Items) { if (item.Selected == true) { SupplierCity sc = new SupplierCity(); sc.CityId = Convert.ToInt64(item.Value); sc.SupplierId = SupplierId; sc.Save(); } } } }