title: How does RedirectToRouteResult work?
body: <p>I'm currently using <code>RedirectToRouteResult</code> as follow:</p>
  
  <pre><code>public void OnAuthorization(AuthorizationContext filterContext)
  {
      User user = filterContext.HttpContext.Session["user"] as User;
      if (user == null || user.Role != expectedRole)
      {
          filterContext.Result = new RedirectToRouteResult(
              new RouteValueDictionary {
                  {"controller", _controller}, {"action", _action}
          });
      }
  }
  </code></pre>
  
  <p>This code is in my <code>CheckLoginAttribute</code> class.</p>
  
  <p>I intend to use it as decorator on specific controller actions for example:</p>
  
  <pre><code>[CheckLogin(RolesEnum.Member, "MyController", "MyAction")]
  public JsonResult GetNews()
  </code></pre>
  
  <p>So basically, I'm trying to short circuit a call to GetNews() and skip the execution of the action if the user is not logged on. If the user is not logged on then I want it to redirect to another action.</p>
  
  <p>Will <code>RedirectToRouteResult</code> redirect to the appropriate action server side without having to do a big loop through the client side (like rewritting window URL location or something like that)? Is that how it works?</p>