Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. @model Parent1
  2.  
  3. @{
  4. ViewBag.Title = "Parent1";
  5. Layout = "~/Views/Shared/_Layout.cshtml";
  6.  
  7. }
  8. @Html.Action("Child","MainControler")
  9.  
  10. @model Parent2
  11.  
  12. @{
  13. ViewBag.Title = "Parent2";
  14. Layout = "~/Views/Shared/_Layout.cshtml";
  15.  
  16. }
  17. @Html.Action("Child","MainControler")
  18.  
  19. public ActionResult parent1() //GET
  20. {
  21. Parent1Model model = new Parent1Model()
  22. return View(model );
  23. }
  24. public ActionResult parent2() //GET
  25. {
  26. Parent2Model model = new Parent2Model()
  27. return View(model );
  28. }
  29. public ActionResult Child() //GET
  30. {
  31. ChildModel model = new ChildModel()
  32. return View(model );
  33. }
  34.  
  35. [HttpPost]
  36. public ActionResult Child(ChildModel model) //POST
  37. {
  38. DoThingsWithResult(model)
  39.  
  40. // The next line should return the get of the parent action
  41.  
  42. return RedirectToParent() // This does not exist...
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement