public ActionResult SaveQuestions(QuestionsViewModel newQuestion, string Command) { newQuestion.TestId = (int)TempData.Peek("TestId"); TempData["TestId"] = newQuestion.TestId; int questionId = 0; if (ModelState.IsValid) { questionId = questionService.InsertQuestion(newQuestion); TempData["QuestionId"] = questionId; if (Command == "Create Options") { return(RedirectToAction("CreateAnswer", "Answer")); } } return(View()); }