title: Blazor server page with parameters throwing "404 not found " on manual refreshes
body: <p>I have a Blazor Server app with a page that takes in parameters in the uri. When I click on an anchor tag that has the route setup to hit that page with params (like below) the link works fine, and the page loads.</p>
  <pre class="lang-html prettyprint-override"><code>&lt;a href=&quot;/MyPage/{@Param1}/{@Param2}&quot;&gt; &lt;!--link content in here--&gt; &lt;/a&gt;
  </code></pre>
  <p>However, if one tries to access the page from that url directly, or manually refreshes in the browser, then the page doesn't reinitialize or hit any breakpoints on the parameters. Instead, it throws a 404 not found.</p>
  <p>So two things here:</p>
  <ul>
  <li>Firstly, I'm confused about why it works fine from within the anchor tag, but dies any other way. Especially when pages without params in the <code>@page</code> directive work fine with refreshes/direct-urls.</li>
  <li>Second, is this an intended behavior for Blazor Server or am I missing something here that's breaking the page refreshes/hitting-url-directly? Doesn't seem like a feature, but maybe I'm misunderstanding Blazor's routing.</li>
  </ul>
  <p>Razor and Razor.cs for page in question:</p>
  <pre class="lang-html prettyprint-override"><code>@page &quot;/MyPage/{Param1}/{Param2}&quot;
  
  &lt;h1&gt;MyPage&lt;/h1&gt;
  
  &lt;Metrics Param1=&quot;@Param1&quot; /&gt;
  
  &lt;Details Param1=&quot;@Param1&quot; Param2=&quot;@Param2&quot; /&gt;
  
  &lt;InProgress Param1=&quot;@Param1&quot; Param2=&quot;@Param2&quot; /&gt;
  
  &lt;InQueue Param1=&quot;@Param1&quot; /&gt;
  
  &lt;br /&gt;
  </code></pre>
  <pre><code>using System;
  using System.Linq;
  using System.Threading.Tasks;
  using System.Collections.Generic;
  using Microsoft.AspNetCore.Components;
  using MyApp.Data.Models.ApiResponse;
  
  namespace MyApp.Pages
  {
      public partial class MyPage
      {
          [Parameter]
          public string Param1 { get; set; }
  
          [Parameter]
          public string Param2{ get; set; }
  
          public TaskList Tasks { get; set; }
  
          protected override Task OnInitializedAsync()
          {
              // work in progress, intend to do more here later on
              var test = &quot;&quot;;
              return base.OnInitializedAsync();
          }
      }
  }
  
  </code></pre>
  <p>Edit(s) -- per comment suggestions</p>
  <p>UseEndpoints section of Configure method in Startup.cs:</p>
  <pre><code> app.UseEndpoints(endpoints =&gt;
              {
                  endpoints.MapBlazorHub();
                  endpoints.MapFallbackToPage(&quot;/_Host&quot;);
              });
  </code></pre>
  <p>After further digging I noticed that the @param2 will occaionally have a <code>.</code> char in it. Blazor does have a need for configuring routes that have <a href="https://docs.microsoft.com/en-us/aspnet/core/blazor/fundamentals/routing?view=aspnetcore-5.0#routing-with-urls-that-contain-dots" rel="noreferrer">params with dots in them</a>. The below fall back doesn't work:</p>
  <pre><code>endpoints.MapFallbackToPage(&quot;/MyPage/{Param1}/{Param2}&quot;, &quot;/MyPage&quot;);
  </code></pre>
  <p>It throws an:
  <code>InvalidOperationException: Cannot find the fallback endpoint specified by route values: { page: /MyPage, area: }.</code></p>
  <p>I'm guessing that the <code>area:</code> being empty is a problem but I'm not finding how or where to properly set that. The example from the link shows just the Page's name in the fallback. Could someone please point out what's wrong with this fall back and how one can properly correct it?</p>