Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The POST request does not specify which form is being submitted. #53382

Closed
javiercn opened this issue Jan 15, 2024 Discussed in #52814 · 2 comments
Closed

The POST request does not specify which form is being submitted. #53382

javiercn opened this issue Jan 15, 2024 Discussed in #52814 · 2 comments
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Duplicate Resolved as a duplicate of another issue

Comments

@javiercn
Copy link
Member

Discussed in #52814

Originally posted by dosni December 14, 2023
I have a FluentUI User Interface below

Why the only thing this works is only when I declare as
@rendermode InteractiveServer

If I removed it or changed it to

@rendermode InteractiveWebAssembly

It will throw an exception :

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

@Inject AuthServices _authService

Register

<EditForm Model="@user" OnValidSubmit="@HandleRegistration">
    <DataAnnotationsValidator />
    <FluentValidationSummary />
    <FluentStack Orientation="Orientation.Vertical">
        <FluentGrid Spacing="3" >
            <FluentGrid Justify="JustifyContent.Center">
                <FluentGridItem xs="8">
                    <FluentGrid>
                        <FluentGridItem xs="12">
                            <FluentTextField Appearance="FluentInputAppearance.Outline" style="width: 100%;" @bind-Value="user.Username" Placeholder="User Name" />
                        </FluentGridItem>
                        <FluentGridItem xs="12">
                            <FluentTextField Appearance="FluentInputAppearance.Outline" style="width: 100%;" @bind-Value="user.Password" Placeholder="Password" />
                        </FluentGridItem>
                    </FluentGrid>
                </FluentGridItem>
            </FluentGrid>
        </FluentGrid>
        <FluentGrid Spacing="3" Justify="JustifyContent.Center">
            <FluentGridItem xs="8" >
                <FluentButton Type="ButtonType.Submit" Appearance="Appearance.Accent" Style="width:100%">
                    <FluentIcon Slot="start" Icon="Icons.Regular.Size24.Save" Color="Color.Lightweight" />Simpan
                </FluentButton>
            </FluentGridItem>
        </FluentGrid>
    </FluentStack>

</EditForm></div>
@javiercn javiercn added the area-blazor Includes: Blazor, Razor Components label Jan 15, 2024
@javiercn
Copy link
Member Author

What's happening here is that we only attach the _handler hidden field during prerendering.

@javiercn
Copy link
Member Author

Dupe of #53129

@javiercn javiercn added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Duplicate Resolved as a duplicate of another issue
Projects
None yet
Development

No branches or pull requests

1 participant