AuthorBuddy/Components/Pages/NotFound.razor
2026-05-25 06:38:16 +02:00

22 lines
534 B
Text

@page "/not-found"
@inject ILocalizationService Loc
@rendermode InteractiveServer
<PageTitle>@Loc["page.title.not_found"]</PageTitle>
<h1>@Loc["notfound.heading"]</h1>
<p>@Loc["notfound.message"]</p>
<a href="/">@Loc["notfound.link.back_to_home"]</a>
@code {
[CascadingParameter]
private HttpContext? HttpContext { get; set; }
protected override void OnInitialized()
{
if (HttpContext is not null)
{
HttpContext.Response.StatusCode = StatusCodes.Status404NotFound;
}
}
}