ASP.NET MVC 2 application
I have two actions on my controller (Toons):
The application works in IIS7 integration mode, therefore / Toons / List works fine. But when I do a POST (which redirects / Toons / List inside), it redirects (with 302 objects moved) back to / Toons / Add.
The problem disappears if I use .aspx hack (works in classic IIS6 / IIS7 mode).
But without .aspx - GET works fine, but POST redirects me to itself, but with GET.
What am I missing?
I go to webhost4life.com and they have already changed IIS7 to integrated mode.
The EDIT: . The code works as expected using the UltiDev Cassini server.
EDIT: It turned out to be a slash-in-URL tracking issue. Somehow, IIS7 sends the request incorrectly if there is no slash at the end.
EDET: Behavior Explanation
What happens when I request (POST) /Toons/List(without a trailing slash), IIS does not find a handler (I have no knowledge to understand exactly how IIS does URL-to-handler matching) and redirects the request (using 302 ) to /Toons/List/(note the trailing slash).
The browser, according to the HTTP specification, should redirect the request using the same method (in this case, POST), but instead it processes 302 as if it were 303 and returns a GET for the new URL.
This is an incorrect but well-known behavior of most browsers.
, .aspx-hack, IIS, ASP.NET IIS ASP.NET.
Q:, ?