public ActionResult AddStudent(AddStudentModel model, string returnUrl) { var objUtilities = new Utilities.Utilities(); bool validateInsertTeacherRecord = objUtilities.InsertStudentRecord(model); if (validateInsertTeacherRecord) { return(RedirectToAction("Index", "Home")); } ModelState.AddModelError("", "UserName or StudentId Already exists."); return(View()); }