2 Answers
2

Ok - found the answer. As I expected, IIS is hijacking my non 200 responses. Not sure (ie. I'm not sure if this is the default behaviour OR it's because of a setting one of the team members updated in the machine config, etc...).

Anyways, the key here is tell IIS to not handle any non-200 status result resources.

But that is irrelvant. Quite a number of browsers by default do NOT show that output, but something set in the browser. So, if you rely on people seeing your 404 page - that may not happen. They may see the 404 page that is set up in the browser for them.

Why shouldn't i be rendering a view on a 404? i want a custom page, and my page might require some logic (instead of a static html error page).
–
Pure.KromeMar 18 '10 at 14:40

ecause the MVC model does not integrate with the IIS error page model. That simple. You ahve to go back to the IIS model for that. Register a page URL for the 404 case. Put some dynamic page there - I am not sure whether this actually COULD point back to a MVC url, but it MUSt originate in the 404 page registration.
–
TomTomMar 18 '10 at 14:55

Incorrect. Most browsers will render the content of a page returned with a 404 HTTP status. Not all, but most. Also, IIS by default will respect the status code as set by any code in a .NET site, as long as no other modules are overriding that later in the pipeline. See the question author's answer on how that was happening in this case.
–
MufasaMar 19 '10 at 22:47