© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
2 replies
Duch Jessie

blazor implementing 404 page

blazor web app .net 8 not triggering <NotFound> tag how to fix it ?
@using BlazorApp33.Components.Account.Shared
<Router AppAssembly="@typeof(Program).Assembly">
    <Found Context="routeData">
        <AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)">
            <NotAuthorized>
                <RedirectToLogin />
            </NotAuthorized>
        </AuthorizeRouteView>
        <FocusOnNavigate RouteData="@routeData" Selector="h1" />
    </Found>
    <NotFound>
        <h1>404 Not Found</h1>
    </NotFound>
</Router>
@using BlazorApp33.Components.Account.Shared
<Router AppAssembly="@typeof(Program).Assembly">
    <Found Context="routeData">
        <AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)">
            <NotAuthorized>
                <RedirectToLogin />
            </NotAuthorized>
        </AuthorizeRouteView>
        <FocusOnNavigate RouteData="@routeData" Selector="h1" />
    </Found>
    <NotFound>
        <h1>404 Not Found</h1>
    </NotFound>
</Router>
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ ✅ blazor.webassembly.js 404 with GitHub Pages
C#CC# / help
3y ago
Implementing OpenIddict in Blazor Hybrid
C#CC# / help
13mo ago
❔ Page debugging twice in razor pages PageRouteModelConvention
C#CC# / help
4y ago
Blazor Page not updating model
C#CC# / help
2y ago