I have two actions: one for HttpGet with this signature:
[Route("NewsLetter/SelectEmail/{page?}")] [HttpGet] public ActionResult SelectEmail(int? page, string priCat, string secCat) { ... }
And one for HttpPost with this signature:
[HttpPost] [ValidateAntiForgeryToken] public ActionResult SelectEmail(int id) { ... }
After setting the above route for the HttpGet method, I noticed that the other method with HttpPost stops working, after I dig, I realized that the route for HttpGet also set for HttpPost >, and this did not work until I explicitly set for its routing attribute:
[Route("NewsLetter/SelectEmail/{id}")] [HttpPost] [ValidateAntiForgeryToken] public ActionResult SelectEmail(int id) { ... }
I wanted to know is this a mistake? If this is not the case, do you still need to set the routing attribute for [HttpGet] without also executing the corresponding [HttpPost] ?
source share