AuthorBuddy/Components/Pages/NotFound.razor

23 lines
534 B
Text
Raw Permalink Normal View History

2026-05-14 12:31:35 +02:00
@page "/not-found"
2026-05-25 06:38:16 +02:00
@inject ILocalizationService Loc
2026-05-14 12:31:35 +02:00
@rendermode InteractiveServer
2026-05-25 06:38:16 +02:00
<PageTitle>@Loc["page.title.not_found"]</PageTitle>
2026-05-14 12:31:35 +02:00
2026-05-25 06:38:16 +02:00
<h1>@Loc["notfound.heading"]</h1>
<p>@Loc["notfound.message"]</p>
<a href="/">@Loc["notfound.link.back_to_home"]</a>
2026-05-14 12:31:35 +02:00
@code {
[CascadingParameter]
private HttpContext? HttpContext { get; set; }
2026-05-25 06:38:16 +02:00
protected override void OnInitialized()
2026-05-14 12:31:35 +02:00
{
if (HttpContext is not null)
{
HttpContext.Response.StatusCode = StatusCodes.Status404NotFound;
}
}
}