public ActionResult Delete(int id, FormCollection collection) { if ((bool)Session["Login"]) { try { MetaniContext context = new MetaniContext(); context.DeleteJenisTanah(id); return(RedirectToAction("Index")); } catch { return(View()); } } return(RedirectToAction("Login", "Admin")); }