public ActionResult Apply(StudentApplicationModel studentApplicationModel) { //Validate from JICS that studentID is valid // if not valid, show error invalid student id. //IStudentRepository repository = new Jenzabar(); IStudentRepository repository = new StudentRepository(); var isValidId = repository.VerifyStudentId(studentApplicationModel.StudentId); if (!isValidId) { return View("InvalidStudentId"); } var student = repository.GetApplicant(studentApplicationModel.StudentId); //return View("Apply", StudentApplicationModel); //TempData["Id"] = StudentApplicationModel.StudentId; //TempData["VehicleType"] = StudentApplicationModel.VehicleType.ToString(); //Redirect to appropriate controller- Vehicle, Bicycle, or Motorcycle var controllerName = studentApplicationModel.VehicleType.ToString(); return RedirectToAction("Register", controllerName, new { id = student.Id, firstName = student.Firstname.Trim(), lastName = student.Lastname.Trim() }); }