Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save motowilliams/1307856 to your computer and use it in GitHub Desktop.
Save motowilliams/1307856 to your computer and use it in GitHub Desktop.
Getting-started-with-MVCContrib-Filters
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