In Blazor Client a redirection can be achieved using
using Microsoft.AspNetCore.Blazor.Browser.Services;
(...)
BrowserUriHelper.Instance.NavigateTo("/route")
This does however not work in a Blazor Server project, as it generates the following error:
Unable to cast object of type 'Microsoft.AspNetCore.Blazor.Server.Circuits.RemoteJSRuntime' to type 'Microsoft.JSInterop.IJSInProcessRuntime'.
How does a redirect in Blazor-Server look like?
If you can trigger on the razor page, you can use the following:
@page "/YourPageName"
@inject NavigationManager NavigationManager
<h1>xxx</h1>
.
.
.
@code {
void MethodToTriggerUrl()
{
NavigationManager.NavigateTo("PageToRedirect");
}
}