title: Routing to an aspx page on a project with webforms and MVC
body: <p>I've added MVC to an existing webforms project that I've been working on as I'm looking to slowly migrate the project, however, during the change over period I need to be able to access both, but have it default to the aspx pages.</p>
  
  <p>When it comes to registering the routing, I currently have this in place:</p>
  
  <pre><code>    private void RegisterRoutes(RouteCollection routes)
      {
          routes.IgnoreRoute("{resource}.aspx/{*pathInfo}");
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
          routes.MapPageRoute("Backup", "{*anything}", "~/Default.aspx");
  
          routes.MapRoute(
              "MVC", 
              "{controller}/{action}/{id}", 
              new { controller = "Test", action = "Index", id = 1 }
          );
      }
  </code></pre>
  
  <p>However, when I have it setup like this, even if I put in a URL that I know refers to a controller/action combination (e.g. Test and Index from the last line of this), it still redirects the user to the Default.aspx page.</p>
  
  <p>I've tried changing this over to the following:</p>
  
  <pre><code>    private void RegisterRoutes(RouteCollection routes)
      {
          routes.IgnoreRoute("{resource}.aspx/{*pathInfo}");
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
          routes.MapRoute(
              "MVC",
              "{controller}/{action}/{id}",
              new { controller = "Test", action = "Index", id = 1 }
          );
  
          routes.MapPageRoute("Backup", "{*anything}", "~/Default.aspx");
      }
  </code></pre>
  
  <p>Here, the user can specify a page or specify a controller/action, but if they do not include any controller/aspx page, it defaults to the default MVC route, whereas I need it to default to the webform Default.aspx.</p>
  
  <p>How would I get around the situation so that if no page/controller is specified, it directs to ~/Default.aspx, and if a controller is specified, it directs to that controller?</p>