protected void btnDelete_Click(object sender, EventArgs e) { string formCodes = ""; for (int i = 0; i < gvForms.Rows.Count; i++) { CheckBox chkUser = (CheckBox)(gvForms.Rows[i].FindControl("chkForm")); if (chkUser.Checked) { HiddenField hfFormCode = (HiddenField)(gvForms.Rows[i].FindControl("hfFormCode")); formCodes += hfFormCode.Value + ";"; } } if (formCodes.LastIndexOf(';') == (formCodes.Length - 1)) { formCodes = formCodes.Remove(formCodes.LastIndexOf(';')); } if (formCodes != "") { //DBManager.DeleteExtProp(formCodes); UserProfileBLL bll = new UserProfileBLL(); bll.DeleteExtProp(formCodes); BindData(); } }