I want to setup some ‘stuff’ at the start of a controller action, and tear it down after a page has been rendered. I’ve achieved this by overriding the ‘OnActionExecuting’ and ‘OnResultExecuted’ filters (I’m using MVC 2).
The big question I have at the moment is, how reliably are these two filters called?
If the answer to that isn’t 100% of the time, I reckon the easiest way to progress this, would be to use some custom filters (specifying the order of them to ‘first’ and ‘last’…
100% of the time. Its part of the MVC pipeline. If they didn’t it would be a pretty big security hole with the
AuthorizeAttribute.