title: MVC3: Is it possible to change the result type outside of the code of the action itself?
body: <p>If I create an controller method that returns ActionResult, then call View() at the end, is there any way to have a Filter (or something simular) change the returned result from the ViewResult emitted by View() to a PartialViewResult based on conditions in the Request?</p>
  
  <p>Clearly I can have code in the controller method itself that returns the ViewResult or PartialViewResult, but this comes up in a number of places so it seems like a good use of a Filter.  I tried doing this in both methods of the IResultFilter and saw no change in the output.</p>
  
  <p>If this is not possible then I will look at creating some methods in my base controller called something like ViewOrPartial that I can call instead of View, but I wanted to seek broader wisdom before giving up on the Filter (or something like it) approach.</p>
  
  <p>Thanks,
  Matthew</p>
  
  <p>Update: So it appears that at least one difference between what I had tried and what is now working based on Darin's code is that I had overridden OnResultExecuting (and I had also tried OnResultExecuted) and Darin's code overrides OnActionExecuted.  Does that seem odd or am I perhaps overlooking something else?  I am delighted to have it working but it seemed to make more sense that to attach it to the IResultFilter interface.  I will have to look into the intention of the two interfaces more.</p>