protected void btnFolioAssociation_Click(object sender, EventArgs e) { string HiddenVal = hdnStatusValue.Value; if (Session["FolioId"] != "") { FolioId = int.Parse(Session["FolioId"].ToString()); } if (HiddenVal == "1") { bool isDeleteMFFolioId; isDeleteMFFolioId = CustomerTransactionBo.DeleteMFFolio(FolioId); if (isDeleteMFFolioId) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('CustomerMFFolioView','none');", true); } else { ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", @"alert('Folio can not be deleted as some Transactions are Associated with this Folio Number.');", true); } } }