protected void btnDelete_Click(object sender, EventArgs e) { int returnNumber = -1; int rowNumber = 0; rowNumber = GetSelectedRow(); if (rowNumber >= 0) { string pageID = dgOutline.Items[rowNumber].Cells[0].Text; CMSBL cmsBL = new CMSBL(); returnNumber = cmsBL.DeleteOutline(hdnSiteID.Value, pageID); } /*for (int i = 0; i < dgOutline.Items.Count; i++) { CheckBox chkFlag; chkFlag = (CheckBox)dgOutline.Items[i].Cells[0].FindControl("chkSelect"); if (chkFlag.Checked) { string pageID = dgOutline.Items[i].Cells[0].Text; CMSBL cmsBL = new CMSBL(); returnNumber = cmsBL.DeleteOutline(hdnSiteID.Value, pageID); } }*/ if (returnNumber > 0) { lblMessage.Text = "Successfully deleted the Outline."; lblMessage.ForeColor = System.Drawing.Color.Green; LoadOutlineDetails(); } else { lblMessage.Text = "Outline Not Deleted."; lblMessage.ForeColor = System.Drawing.Color.Red; } }