title: How to redirect to a route in an ActionResult in ASP.Net MVC 3
body: <p>I am trying to create an access denied ActinoResult to return from my controllers. I have the following implementation</p>
  
  <pre><code>public class AccessDeniedResult : ActionResult
  {
      public override void ExecuteResult(ControllerContext context)
      {
          if (null != context &amp;&amp; null != context.HttpContext &amp;&amp; null != context.HttpContext.Response)
          {
              context.HttpContext.Response.StatusCode = 401;
              context.HttpContext.Response.RedirectToRoute("AccessDenied");
          }
      }
  }
  </code></pre>
  
  <p>This does not work because of a NotImplementedException coming from HttpResponseBase being passed as context.HttpContext.Response.</p>
  
  <p>How do you write a correct redirecting action result in MVC3?</p>