// // GET: /Post/Edit/5 public ActionResult Edit(int id) { ViewData["Topic"] = "The topic title in the current context"; var post = new PostInput { TopicId = 432, Author = "Author of post", Body = "this is the body of the post that is being edited" }; return View(post); }
public ActionResult Edit(int id, PostInput input) { try { // TODO: Add update logic here return RedirectToAction("Details", "Topic", new {Id = input.TopicId}); } catch { return View(); } }
public ActionResult Create(PostInput input) { try { // TODO: Add insert logic here return RedirectToAction("Details", "Topic", new {Id = input.TopicId}); } catch { return View(); } }