-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Setting app.UseStatusCodePagesWithReExecute("/not-found", createScopeForStatusCodePages: true);
re-executes to the "not-found" page that is static, adding any interactivity, e.g. a button does not work.
The behavior is not consistent with the NavigationManager.NotFound()
behavior that renders the "not-found" page with interactivity.
It's a matter of fixing
aspnetcore/src/Components/Endpoints/src/Rendering/EndpointHtmlRenderer.Prerendering.cs
Line 23 in 318c481
if (_isHandlingErrors || _isReExecuted) |
Expected Behavior
The re-executed page should be interactive.
Steps To Reproduce
Add
@rendermode RenderMode.InteractiveServer
<p role="status">Current count: @currentCount</p>
<button id="increment-button" class="btn btn-primary" @onclick="IncrementCount">Click me</button>
@code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount++;
}
}
to the NotFound.razor
page.
Exceptions (if any)
No response
.NET Version
10
Anything else?
No response
Metadata
Metadata
Assignees
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components