protected void btnChose_Click(object sender, EventArgs e) { try { var ids = new List <Guid>(); foreach (RepeaterItem item in dataList.Items) { var check = item.FindControl("checkboxone") as CheckBox; var hdID = item.FindControl("hdID") as HiddenField; if (check == null || hdID == null) { continue; } if (check.Checked) { ids.Add(Guid.Parse(hdID.Value)); } } if (ids.Any()) { ids.ForEach(p => CompanyService.AddGroupMember(GroupId, p, CurrentUser.UserName)); Response.Redirect("CompanyGroupMemberList.aspx?groupId=" + GroupId); } } catch (Exception ex) { ShowExceptionMessage(ex, "添加公司组成员"); } }