title: How to add controller (not view) support to a server-side Blazor project
body: <p>While my server-side Blazor app is running, I want some Javascript code in <code>_Host.cshtml</code> to be able to post data to a controller action. Of course, this happens completely outside of the scope of, and is unrelated to, the Blazor app itself.</p>
  
  <p>I thought this would be a matter of adding calls to <code>services.AddControllers()</code> and <code>endpoints.MapControllers()</code> at the appropriate places in <code>Startup.cs</code>. However, after doing this, and implementing the controller action, I made the following observations:</p>
  
  <ul>
  <li>Requests to the action are not routed and treated as "not found"</li>
  <li>In Razor, <code>@Url.Action</code> on the controller action returns a blank string</li>
  </ul>
  
  <p>How can I add controller (not view) support to my server-side Blazor project in a way that overcomes the above two issues?</p>