I can't seem to figure out how to custom handle this error. I have a endpoint defined like this:
[HttpGet] public ActionResult Test() { ... }
If I try to POST to this endpoint it throws the http 405 error which is correct. The problem is I want to provide a custom error page and not the IIS default one. I've tried breaking in the application_error method in global.asax but it never get's called, and I've tried adding the <customErrors />
section in web.config but to no avail.
Any suggestions?