Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ViewResult Save(Model modelToSave)
- {
- if(ModelState.isValid)
- {
- modelToSave.Save();
- // redirects to the list action if the save is successful
- return RedirectToAction("Index");
- }
- //if there are any errors, the same edit View is returned.
- return View("Edit", modelToSave);
- }
Add Comment
Please, Sign In to add comment