public ActionResult CreateAnswer(FormCollection collection) { try { string answerName = collection["AnswerName"]; int questionId = Int32.Parse(collection["Question"]); int weightId = Int32.Parse(collection["Weight"]); TaskManager.AddAnswer(answerName, questionId, weightId); // TODO: Add insert logic here return(RedirectToAction("AnswersIndex")); } catch { return(View()); } }