<p>I am looking to set the result action from a failed IAuthorizationFilter.  However I am unsure how to create an ActionResult from inside the Filter.  The controller doesn't seem to be accible from inside the filter so my usual View("SomeView") isn't working.  Is there a way to get the controler or else another way of creating an actionresult as it doesn't appear to be instantiable?</p>

<p>Doesn't work:</p>

<pre><code>    [AttributeUsage(AttributeTargets.Method)]
    public sealed class RequiresAuthenticationAttribute : ActionFilterAttribute, IAuthorizationFilter
    {
    public void OnAuthorization(AuthorizationContext context)
    {
        if (!context.HttpContext.User.Identity.IsAuthenticated)
        {
            context.Result = View("User/Login");
        }
    }
}
</code></pre>

You can instantiate the appropriate ActionResult directly, then set it on the context. For example:
```
```
public void OnAuthorization(AuthorizationContext context)
{
    if (!context.HttpContext.User.Identity.IsAuthenticated)
    {
        context.Result = new ViewResult { ViewName = "Whatever" };
    }
}
```
```