title: ASP.NET Core 5 AnchorTagHelper not working on razor page
body: <p>I have a simple anchor tag helper in my Razor <code>_layout.cshtml</code> page; however no url is appearing on the first one but is on the second.</p>
  <p>The <code>asp-for</code> attribute is pulling the value from a simple const string and both tag helpers are obtaining it from the same place.</p>
  <pre class="lang-cs prettyprint-override"><code>public static class PageNavigation
  {
      public const string Manage = &quot;/account/manage&quot;;
      public const string Logout = &quot;/account/logout&quot;;
  }
  </code></pre>
  <p>Tag helper in <code>_layout.cshtml</code> page:</p>
  <pre class="lang-cs prettyprint-override"><code>&lt;a asp-page=&quot;@PageNavigation.Manage&quot; class=&quot;dropdown-item notify-item&quot;&gt;
      &lt;i class=&quot;mdi mdi-account-circle mr-1&quot;&gt;&lt;/i&gt;
      &lt;span&gt;My Account&lt;/span&gt;
  &lt;/a&gt;
  
  &lt;a asp-page=&quot;@PageNavigation.Logout&quot; class=&quot;dropdown-item notify-item&quot;&gt;
      &lt;i class=&quot;mdi mdi-account-circle mr-1&quot;&gt;&lt;/i&gt;
      &lt;span&gt;Logout&lt;/span&gt;
  &lt;/a&gt;
  </code></pre>
  <p>Output:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;a class=&quot;dropdown-item notify-item&quot; href=&quot;&quot;&gt;
      &lt;i class=&quot;mdi mdi-account-circle mr-1&quot;&gt;&lt;/i&gt;
      &lt;span&gt;My Account&lt;/span&gt;
  &lt;/a&gt;
  &lt;a class=&quot;dropdown-item notify-item&quot; href=&quot;/account/logout/&quot;&gt;
      &lt;i class=&quot;mdi mdi-logout mr-1&quot;&gt;&lt;/i&gt;
      &lt;span&gt;Logout&lt;/span&gt;
  &lt;/a&gt;
  </code></pre>
  <p>As you can see, the first tag has no href attribute value; this is a bit weird and I cannot work out why and unfortunately I cannot easily debug into the AnchorTagHelper native source, I only end up in the output writer classes and not the actual tag helper source.</p>
  <p><strong>EDIT:</strong></p>
  <p>Further editing indicates I cannot seem to output anything but a single anchor tag helper in this manner ... no matter how many create, in any order, only the &quot;Logout&quot; one appears correctly.</p>
  <p>The only way for me to get this to work is to just use a normal anchor tag using the <code>href</code> attribute.</p>
  <p>On a separate point; it makes me wonder what the point of the Anchor Tag helper is for Razor pages. You can't map it in a strongly typed manner to a specific Razor page and even with 'route' attributes, its a very long-winded way of just adding an anchor tag like normal.</p>