title: ASP.NET MVC Routing - Redirect to aspx?
body: <p>This seems like it should be easy, but for some reason I'm having no luck.  I'm migrating an existing WebForms app to MVC, so I need to keep the root of the site pointing to my existing aspx pages for now and only apply routing to named routes.  Here's what I have:</p>
  
  <pre><code>    public static void RegisterRoutes(RouteCollection routes)
      {
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
          routes.IgnoreRoute("{resource}.aspx/{*pathInfo}");
  
          RouteTable.Routes.Add(
              "Root",
              new Route("", new DefaultRouteHandler())
          );
  
          routes.MapRoute(
              "Default",                                              // Route name
              "{controller}/{action}/{id}",                           // URL with parameters
              new { controller = "Calendar2", action = "Index", id = "" }  // Parameter defaults
          );
      }
  </code></pre>
  
  <p>So aspx pages should be ignored, and the default root url should be handled by this handler:</p>
  
  <pre><code>public class DefaultRouteHandler : IRouteHandler
  {
      public IHttpHandler GetHttpHandler(RequestContext requestContext)
      {
          return System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(
                  "~/Dashboard/default.aspx", typeof(Page)) as IHttpHandler;
      }
  }
  </code></pre>
  
  <p>This seems to work OK, but the resulting YPOD gives me this: </p>
  
  <blockquote>
    <p>Multiple controls with the same ID
    '__Page' were found. Trace requires
    that controls have unique IDs.</p>
  </blockquote>
  
  <p>which seems to imply that the page is somehow getting rendered twice.  If I simply type in the url to my dashboard page directly it works fine (no routing, no error).  I have no idea why the handler code would be doing anything differently.</p>
  
  <p>Bottom line -- I'd like to simply redirect the root url path to an aspx of my choosing -- can anyone shed some light?</p>