public ActionResult BuildTimetable(string choices, int termId) { Student student = (Student)Session["student"]; Dictionary <int, int> newChoices = JsonConvert.DeserializeObject <Dictionary <int, int> >(choices); bool success = dao.UpdateEnrollment(student.StudentId, termId, newChoices); if (success) { return(RedirectToAction("Index")); } else { return(RedirectToAction("BuildTimetable", new { TermId = termId })); } }