I have a Blazor server-side app and I added the following in _Host.cshtml:
<base href="~/Sub" />I also changed the launchsettings.json:
{"iisSettings": {"windowsAuthentication": false,"anonymousAuthentication": true,"iisExpress": {"applicationUrl": "http://localhost:58014/Sub","sslPort": 44309 } },"profiles": {"IIS Express": {"commandName": "IISExpress","launchBrowser": true,"environmentVariables": {"ASPNETCORE_ENVIRONMENT": "Development" } } }}My entry point is Home.razor with the following attribute:
@page "/"I use either an anchor tag, NavLink or the NavigationManager to go to other pages, for example:
<li class="nav-item"><a class="nav-link" target="_self" href="/">Home</a></li>or:
navigationManager.NavigateTo("/", true, true);However the base ref is being ignored.
How can I make sure that the navigation automatically includes the base ref defined?