Created
October 23, 2011 20:33
-
-
Save motowilliams/1307856 to your computer and use it in GitHub Desktop.
Getting-started-with-MVCContrib-Filters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomerEditModel | |
{ | |
[Required] | |
[DisplayName("First Name")] | |
public string FirstName { get; set; } | |
[Required] | |
[DisplayName("Last Name")] | |
public string LastName { get; set; } | |
} | |
[HttpPost] | |
public ActionResult CreateCustomer(CustomerEditModel customerEditModel) | |
{ | |
if (ModelState.IsValid) | |
{ | |
//Do Something Worthy of your NEW Customer | |
return RedirectToAction("Success"); | |
} | |
return RedirectToAction("FixErrors"); | |
} | |
[HttpGet] | |
public ActionResult FixErrors() | |
{ | |
return View("Index"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment