I am mainly using Interactive render mode: WebAssembly
and Interactivity location: Global
, but the issue exists with each template setting. Can someone give me an indication of what I need to do to implement a simple 404 page?
Update: I was told to add app.UseStatusCodePagesWithReExecute( "/StatusCode/{0}" );
to my Program.cs
(in this case, the server-side one), and then add a page StatusCode.razor
(in this case, on the client) to output the status code:
@page "/StatusCode/{ResponseCode}"
@inherits MainLayout;
<p>@this.ResponseCode</p>
@code {
[Parameter]
public string? ResponseCode { get; set; }
}
This seems to work, but then a moment later it gets replaced with a blank page displaying only Not found
. I assume this is due to some middleware or other, but I have further idea at the moment.