dotnet / dotnet/aspnetcore

Placing EditForm in Section Content Component Causes run-time error

Open
#56,635 5 comments 0 reactions 0 assignees View on GitHub
area-blazor
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Describe the bug

Context
Balzor Web App, Static SSR by default

If you have an interactive server page and you place an edit form in the Section Content component, this will produce the following error when you submit the form

Returned Error message displayed in the browser:

> The POST request does not specify which form is being submitted. To fix this, ensure elements have a @formname attribute with any unique value, or pass a FormName parameter if using .

Code

`
`

The Section outlet is in a sidebar component that is inside a layout component.

``

Debugged Behavior:
The browser performs full postback to the server instead of using the open WebSocket.

### Expected Behavior

The form should submit and the event handler for the edit form's OnSubmit should run. I verified this if I take the Edit Form outside the Section Content component.

The Edit form placed inside section content component does behave correctly on a static SSR page.

### Steps To Reproduce

_No response_

### Exceptions (if any)

_No response_

### .NET Version

_No response_

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.