I forgot to mention, I tried putting a breakpoint inside the httppost actionresult but it didn't seem to even get hit at all. At least not inside it.
Hey all,
I resolved the issue. As it turns out, there was an old 301 redirect rule in our webconfig that was trying to add a trailing slash to the end of the form action. Once it did that, it went through as a get instead of a post. I commented out that rule and everything works perfectly now. Thank you!
Hey all,
I'm creating a simple address editor for our site's customers. Or so I thought. Basically what I seem to be running into is the HttpPost ActionResult in my controller seems to be ignored. I suspect it has something to do with EpiServer's routing. When I submit my form, I'm getting the standard .net 404 error page, and if I view source on it, I notice this message commented out at the bottom:
So cutting to the chase, here's my relevant code:
Controller:
Here is the form in the view:
And finally here is my route configured in /Business/Initialization/RouteConfig.cs:
And in case it's significant, here is where the routes are called in Global.asax.cs:
Important observations so far: It seems like for some reason this is only happening on using the [HttpPost] attribute. I have other ActionResults in that controller that I call async with no problems at all. And in a similar controller I have async Tasks using HttpPost attribute that work just fine as well. It seems to be just these particular circumstances that aren't working and its driving me up a wall :-)
Thank you in advance for any help you can offer.