title: Legacy URL rewriting with query string parameters
body: <p>I've looked at <a href="https://stackoverflow.com/questions/817325/asp-net-mvc-routing-legacy-urls-passing-querystring-ids-to-controller-actions">ASP.Net MVC routing legacy URLs passing querystring Ids to controller actions</a> and several other similar posts for legacy URL routing, but I can't get past the error "The RouteData must contain an item named 'controller' with a non-empty string value." Looking this up on line didn't give me any hints to solve my problem.</p>
  
  <p>I've implemented the Legacy routing class described in the link above, and this is what I've defined in the routing table:</p>
  
  <pre><code>        routes.Add(
              "Legacy", 
              new LegacyRoute("fooref.aspx", 
              "FooRef", 
              new LegacyRouteHandler())
          );
  
          routes.MapRoute(
              "FooRef",
              "{controller}/{action}",
              new
              {
                  controller = "Home",
                  action = "Index",
                  foo_id = UrlParameter.Optional,
                  bar_id = UrlParameter.Optional
              }
          );
  </code></pre>
  
  <p>When I use Phil Haack's route debugger, it indicates that fooref.aspx has a match, but when I turn the route debugger off, I get the error above. If I reverse the statement order, I get "Resource not found" for /ctprefer.aspx, which makes sense -- so it appears to be finding that as a valid route when put in the other order.</p>
  
  <p>Where do I need to declare this missing controller reference? </p>
  
  <p>Have routing requirements changed for ASP.NET MVC 2 RTM?</p>