Skip to content

Instantly share code, notes, and snippets.

@huanlin
Created December 16, 2022 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huanlin/7884c05023ff6e3aa418430dd9e7a671 to your computer and use it in GitHub Desktop.
Save huanlin/7884c05023ff6e3aa418430dd9e7a671 to your computer and use it in GitHub Desktop.
Blazor App.razor
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment