title: How do I restrict access to certain pages in ASP.NET MVC?
body: <p>I wish to lock out access to html page (eg. /manual/manual_A/index.html) 
  if a certain condition is not met (eg. HttpContext.Current.Request.Form["key"].toString().Equals("a") ), I wish redirect to specific view (eg. /errorPage/) else continue (eg. /index).
  In register Route I add:</p>
  
  <pre><code>routes.MapRoute(
                  "ErrorPage",                                             
                 "errorPage/",                          
                  new { controller = "Home", action = "ErrorPage" } 
              );
  
  routes.MapRoute(
                  "Path",                                             
                 "{*_request}",                          
                  new { controller = "Home", action = "Index" } 
              );
  </code></pre>
  
  <p>for read all request.
  In controller Home</p>
  
  <pre><code>[CustomAuthorize] 
     public ActionResult Index()
     {
  
     }
  
  protected override void OnActionExecuting(ActionExecutingContext filterContext)
      {
          if(!condition)
            filterContext.Result = RedirectToAction("PageError");
      }
  </code></pre>
  
  <p>OnActionExecuting executes on every request, however, RedirectToAction does not happen. 
  Any hints as to what I'm doing wrong?</p>