private bool Delete() { bool boRetValue = false; string stIDs = ""; foreach (DataListItem item in lstItem.Items) { HtmlInputCheckBox chkList = (HtmlInputCheckBox)item.FindControl("chkList"); if (chkList != null) { if (chkList.Checked == true) { stIDs += chkList.Value + ","; boRetValue = true; } } } if (boRetValue) { SO clsSO = new SO(); clsSO.Delete(stIDs.Substring(0, stIDs.Length - 1)); clsSO.CommitAndDispose(); } return(boRetValue); }