protected void lbDelete_Click(object sender, EventArgs e) { try { invObj = new InvoiceClass(); invObj.invId = Convert.ToInt32(((LinkButton)sender).CommandArgument); if (invObj.DeleteInvoiceByInvId()) { BindAllInvoice(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "successfull('Invoice Deleted Successfully.','')", true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "failed('Failed to Delete Invoice.','')", true); } } catch (Exception ex) { ex.Message.ToString(); } }