Guest User

Untitled

a guest
Oct 20th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. public ViewResult Save(Model modelToSave)
  2. {
  3. if(ModelState.isValid)
  4. {
  5. modelToSave.Save();
  6. // redirects to the list action if the save is successful
  7. return RedirectToAction("Index");
  8. }
  9. //if there are any errors, the same edit View is returned.
  10. return View("Edit", modelToSave);
  11. }
Add Comment
Please, Sign In to add comment