public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Student student = client.Edit(id); if (student == null) { return(HttpNotFound()); } return(View(student)); }
public ActionResult Edit(int?id) { if (id == null) { TempData[""] = "Student not exist"; return(RedirectToAction("Index")); } Student student = client.Edit(id); if (student == null) { TempData["error"] = "Student not exist"; return(RedirectToAction("Index")); } return(View(student)); }