protected void DeleteController_Click(object sender, ImageClickEventArgs e) { var btn = (ImageButton)sender; var arg = btn.CommandArgument.ToString().Split(','); int EmailConId = Convert.ToInt32(arg[0]); EmailRepository EmailControllerReb = new EmailRepository(); EmailControllerReb.DeleteEmailController(EmailConId); DataTable Users = EmailControllerReb.GetControllerAssignUsers(Convert.ToInt32(arg[1])); foreach (DataRow item in Users.Rows) { EmailControllerReb.DeleteUserEmail(Convert.ToInt32(txtEmailId.Text), Convert.ToInt32(item["UserId"])); } BindControllerRepeater(); }