title: Why am I getting 404 when the route matches? ASP.Net MVC
body: <p>I have been stuck on this issue for several hours now.</p>
  
  <p>I have a controller called 'DecisionPoint' and I have a breakpoint set on it's 'ApplicationState' action. No matter what I try I keep getting a 404 in the browser. I suspected that my route was not correct so I downloaded a route debugger and it turns our the URLs I am trying match the Controller and the action. So why do I get a 404 and never see the breakpoint hit?</p>
  
  <p>/DecisionPoint/ApplicationState/no/worky --> 404</p>
  
  <p>Controller:</p>
  
  <pre><code> public ActionResult ApplicationState(string fileName, string stateString)
          {
              string filePath = GetDpFilePath(fileName);
              HtmlDocument htmlDocument = new HtmlDocument();
              htmlDocument.Load(filePath);
              HtmlNode stateScriptNode =
                  htmlDocument.DocumentNode.SelectSingleNode("/html/head/script[@id ='applicationState']");
              stateScriptNode.InnerHtml = "var applicationStateJSON =" + stateString;
              htmlDocument.Save(filePath);
  
              return Json("State Updated");
  </code></pre>
  
  <p>Route</p>
  
  <pre><code> routes.MapRoute(
          "DecisionPointState", // Route name
          "DecisionPoint/ApplicationState/{fileName}/{stateString}", // URL with parameters
          new {controller = "DecisionPoint", action = "ApplicationState"} // Parameter defaults
      );
  
  
          routes.MapRoute(
              "Default", // Route name
              "{controller}/{action}/{id}", // URL with parameters
              new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
          );
  
  
          }`
  **Update**
  </code></pre>
  
  <p>I create a whole new controller and it works. This is now what my route table looks like. The state controller correclty routes to SaveState</p>
  
  <pre><code> public static void RegisterRoutes(RouteCollection routes)
      {
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
          routes.MapRoute(
             "StateRoute", // Route name
             "State/SaveState/{file}/{state}", // URL with parameters
             new { controller = "State", action = "SaveState", file = UrlParameter.Optional, state = UrlParameter.Optional } // Parameter defaults
         );
  
          routes.MapRoute(
             "DPStateRoute", // Route name
             "DecisionPoint/ApplicationState/{file}/{state}", // URL with parameters
             new { controller = "DecisionPoint", action = "ApplicationState", file = UrlParameter.Optional, state = UrlParameter.Optional } // Parameter defaults
         );
  
  
          routes.MapRoute(
              "Default", // Route name
              "{controller}/{action}/{id}", // URL with parameters
              new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
          );
      }
  
      protected void Application_Start()
      {
          AreaRegistration.RegisterAllAreas();
  
          RegisterRoutes(RouteTable.Routes);
         // RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes);
  
      }
  }
  </code></pre>
  
  <p>So I am stumped.. </p>