public ActionResult Edit(FeedbackInput input) { if (!ModelState.IsValid) { return View("Create", input); } var feedback = repo.Get(input.Id); feedback.Comments = HtmlUtil.SanitizeHtml(input.Comments); repo.Save(); return Json(new { }); }
public ActionResult Create(FeedbackInput input) { if (!ModelState.IsValid) { return View(input); } input.Comments = HtmlUtil.SanitizeHtml(input.Comments); var feedback = new Feedback { Comments = input.Comments }; feedback = repo.Insert(feedback); repo.Save(); Session["lastFeedback"] = feedback.Id; return Json(new { }); }