public ActionResult NewComment(CommentFormViewModel model, int qid, int oid) { if (ModelState.IsValid && _membershipService.IsAuthenticated()) { Comment newComment = new Comment(); newComment.CommentText = model.Comment; newComment.QuestionID = qid; newComment.QuestionOptionID = oid; newComment.UserID = _membershipService.GetCurrentUserId(); _commentRepo.SaveComment(newComment); return RedirectToAction("NewComment", new { qid = qid, oid = oid }); } model.QuestionId = qid; model.AnsweredOptionId = oid; return View("_CommentsForm", model); }
public ActionResult NewComment(int qid, int oid) { CommentFormViewModel model = new CommentFormViewModel(); model.QuestionId = qid; model.AnsweredOptionId = oid; return View("_CommentsForm", model); }