From a97e2ae35afd5a2f912014b3b47e54c45e7b9972 Mon Sep 17 00:00:00 2001 From: Jason Zhu Date: Wed, 14 Jul 2021 21:11:43 +1000 Subject: [PATCH] e.g. 3.111 Adding an Action Method to Support POST Requests --- .../PartyInvites/Controllers/HomeController.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chap3_your_first_mvc_app/PartyInvites/Controllers/HomeController.cs b/chap3_your_first_mvc_app/PartyInvites/Controllers/HomeController.cs index 2dcb141..2797a18 100644 --- a/chap3_your_first_mvc_app/PartyInvites/Controllers/HomeController.cs +++ b/chap3_your_first_mvc_app/PartyInvites/Controllers/HomeController.cs @@ -27,9 +27,17 @@ namespace PartyInvites.Controllers return View(); } + [HttpGet] public ActionResult RsvpForm() { return View(); } + + [HttpPost] + public ActionResult RsvpFrom() + { + // TODO: Email guestResponse to the part organizer + return View("Thanks", guestResponse); + } } } \ No newline at end of file