public ActionResult Edit(int id, StudentModel smodel) { try { if (ModelState.IsValid) { StudentDBHandle dbhandle = new StudentDBHandle(); if (dbhandle.UpdateStudent(smodel)) { ViewBag.Message = "Student details updated Successfully"; } } return(RedirectToAction("Index")); } catch { return(View()); } }