protected void btnYes_Click(object sender, EventArgs e) { try { int rowindex = Convert.ToInt32(ViewState["rowIndex"]); context.sp_Deletebatch(companyId, rowindex, branchId); divalert.Visible = true; lblAlert.Text = "Deleted Successfully"; } catch (Exception ex) { ErrorLog.saveerror(ex); //Do Logging } }