public ActionResult DeleteCrud(int Id) { try { CrudRepo db = new CrudRepo(); if (db.DeleteCrud(Id)) { TempData["success"] = "Deleted Successfully"; return(RedirectToAction("Crud", "Home")); } else { TempData["error"] = "Record Deletion Unsuccessfull"; return(RedirectToAction("Crud", "Home")); } } catch (Exception ee) { TempData["error"] = "Record Not Found or Deleted by Another user"; return(RedirectToAction("Quiz", "Home")); } }