title: MVC 5 Routing with parameter using @Url.RouteUrl
body: <p>I have an ActionResult that I have applied a routing attribute to:</p>
  
  <pre><code>[Route("myproduct/{productID}", Name = "myproduct")]
  [MvcSiteMapNode(Title = "Products", ParentKey = "products", Key = "myproducts")]
  public ActionResult myproducts(int productID) ...
  </code></pre>
  
  <p>I am trying to link to the view via a RouteUrl:</p>
  
  <pre><code>&lt;a href="@Url.RouteUrl("myproducts", @Model.myproducts[i].productID)"&gt;Buy&lt;/a&gt;
  </code></pre>
  
  <p>The resulting html does not even include a href:</p>
  
  <pre><code>&lt;a&gt;Buy&lt;/a&gt;
  </code></pre>
  
  <p>If I remove the parameter it works:</p>
  
  <pre><code>[Route("myproducts", Name = "myproducts")]
  [MvcSiteMapNode(Title = "Products", ParentKey = "home", Key = "myproducts")]
  public ActionResult myproducts(int productID) ...
  
  
  &lt;a href="/products/myproducts"&gt;Book&lt;/a&gt;
  </code></pre>
  
  <p>Am I trying to add the parameter incorrectly? The documentation suggests what I am attempting.</p>
  
  <p>Route Config:</p>
  
  <pre><code>public static void RegisterRoutes(RouteCollection routes)
      {
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
          routes.MapMvcAttributeRoutes();
  
          routes.MapRoute(
              name: "Default",
              url: "{controller}/{action}/{id}",
              defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
          );            
      }
  </code></pre>