Skip to content

Reexecuted page is not interactive #63963

@ilonatommy

Description

@ilonatommy

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

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 Components

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions