title: ASP.NET MVC can't find route programmatically
body: <p>I have the following one route, registered in my global.asax.</p>
  
  <pre><code>routes.MapRoute(
      "Home", // Unique name
      "", // Root url
      new { controller = "Home", action = "Index", 
          tag = string.Empty, page = 1 }
  );
  </code></pre>
  
  <p>kewl. when I start the site, it correctly picks up this route.</p>
  
  <p>Now, when I try to programmatically do the following, it returns NULL.</p>
  
  <pre><code>var pageLinkValueDictionary = 
      new RouteValueDictionar(linkWithoutPageValuesDictionary)
          {{"page", 2}};
  
  VirtualPathData virtualPathData = 
      RouteTable.Routes.GetVirtualPath(viewContext, "Home"
          pageLinkValueDictionary);
  
  // NOTE: pageLinkValueDictionary == 
  //     Key: Action, Value: Index; Key: page, Value: 2
  </code></pre>
  
  <p>Why would this be happening?</p>
  
  <p>I was under the impression that it would find the Home route but append any values not found as query string items?</p>
  
  <h2>Update</h2>
  
  <p>Still no luck with this. Also, using the <a href="https://www.microsoft.com/downloads/details.aspx?FamilyID=f4e4ee26-4bc5-41ed-80c9-261336b2a5b6&amp;displaylang=en" rel="nofollow noreferrer">MVC RC</a>, I now need to change the viewContext to veiwContext.RequestContext .. which compiles but I'm still getting a null result.</p>
  
  <h2>Update 2</h2>
  
  <p>When I have the route without the <code>page=1</code> default item, the route <em>IS FOUND</em>.
  eg.</p>
  
  <pre><code>routes.MapRoute(
          "Home",
          "",
          new { controller = "Post", action = "Index", tags = string.Empty }
      );
  </code></pre>
  
  <p>.. and <code>RouteTable.Routes.GetVirtualPath</code> returns a <code>VirtualPathData</code> instance. When I add the <code>page=1</code> (default value) back in, the <code>VirtualPathData</code> instance returned is null?</p>