e.g. 3.14 Checking for Form Validation Errors

This commit is contained in:
Jason Zhu 2021-07-14 21:33:55 +10:00
parent 82fd44ba0f
commit 044c51ef8b

View File

@ -37,8 +37,16 @@ namespace PartyInvites.Controllers
[HttpPost] [HttpPost]
public ActionResult RsvpForm(GuestResponse guestResponse) public ActionResult RsvpForm(GuestResponse guestResponse)
{ {
// TODO: Email guestResponse to the part organizer if (ModelState.IsValid)
return View("Thanks" ,guestResponse); {
// TODO: Email guestResponse to the part organizer
return View("Thanks", guestResponse);
}
else
{
// there is a validation error - redisplay the for
return View();
}
} }
} }
} }