Handling a NotFound UI
The Router
component in Blazor has two important RenderFragment
parameters. The first one is called Found
and the other one is called NotFound
. You can notice their UI piece values in the App.razor
component:
<Router AppAssembly="@typeof(App).Assembly" AdditionalAssemblies="new[] { typeof(Component1).Assembly }"> <Found Context="routeData"> ... </Found> <NotFound> <PageTitle>Not found</PageTitle> <LayoutView Layout="@typeof(MainLayout)"> <p role="alert">Sorry, there's nothing at this address.</p> ...