title: Attribute Routing With Parameters - Anchor Tag Helper Appending Route-Id Value
body: <p>I have setup the &quot;basic&quot; routes in Startup.cs with nothing out of the ordinary (one for the standard routing and another for areas).  They are below:</p>
  <pre><code>app.UseEndpoints(endpoints =&gt;
  {
      endpoints.MapControllerRoute(
         name: &quot;Areas&quot;,
         pattern: &quot;{area:exists}/{controller=Home}/{action=Index}/{id?}&quot;);
  
      endpoints.MapControllerRoute(
         name: &quot;default&quot;,
         pattern: &quot;{controller=Home}/{action=Index}/{id?}&quot;);
  
      endpoints.MapRazorPages();
  });
  </code></pre>
  <p>Now, with these two, I'm able to navigate (albeit manually) to the routes I want.  Below is an attribute route I have on an action:</p>
  <pre><code>[Route(&quot;Admin/Artists/{artistId:int}/Albums&quot;)]
  public async Task&lt;IActionResult&gt; Albums(int artistId)
  {
      var albums = await Mediatr.Send(new GetAlbumsForArtistRequest { ArtistId = artistId });
  
      return View(albums);
  }
  </code></pre>
  <p>I can successfully browse to that route <em>(albeit manually)</em> and my view appears.  I then try using the anchor tag helper:</p>
  <pre><code>&lt;a asp-area=&quot;Admin&quot; asp-controller=&quot;Artists&quot; asp-action=&quot;Albums&quot; asp-route-artist-id=&quot;@ViewData[&quot;ArtistId&quot;]&quot; class=&quot;btn btn-info&quot;&gt;Albums&lt;/a&gt;
  </code></pre>
  <p>The URL that is generated is not correct (and throws an exception as this route is not defined):</p>
  <pre><code>/Admin/Artists/Albums
  </code></pre>
  <p>When the correct URL should be:</p>
  <pre><code>/Admin/Artists/558/Albums
  </code></pre>
  <p>I have tried finding any help on the <a href="https://docs.microsoft.com/en-us/aspnet/core/mvc/views/tag-helpers/built-in/anchor-tag-helper?view=aspnetcore-3.1" rel="nofollow noreferrer">Anchor Tag Helper documentation</a>, but it was no help.</p>