protected void btnDelete_Click(object sender, EventArgs e) { int returnNumber = -1; int rowNumber = 0; rowNumber = GetSelectedRow(); if (rowNumber >= 0) { string childPageID = dgPages.Items[rowNumber].Cells[0].Text; CMSBL cmsBL = new CMSBL(); returnNumber = cmsBL.DeletePage(hdnSiteID.Value, hdnPageID.Value, childPageID); } if (returnNumber == 1) { lblMessage.Text = "Page Deleted Successfully."; lblMessage.ForeColor = System.Drawing.Color.Green; LoadPageDetails(); } else { lblMessage.Text = "Page Not Deleted."; lblMessage.ForeColor = System.Drawing.Color.Red; } }