Closed likquietlyy closed 2 days ago
Thanks for reaching out.
When submitting a form across pages, the page being submitted to needs to specify a form with the specified @formname
. So, you could put an empty form on the LoginSubmit
page containing a hidden form with an @onsubmit
handler. Does that work for you?
Long-term, we could address this in https://github.com/dotnet/aspnetcore/issues/53129
@MackinnonBuck, It works for me only for SSR form component that submit as HTTP request to SSR endpoint. But if I have form at Interactive Server render mode page that submit as HTTP request to SSR endpoint it still ends with an error message (The POST request does not specify which form is being submitted. To fix this, ensure <form> elements have a @formname attribute with any unique value, or pass a FormName parameter if using <EditForm>.
)
Closing as a dupe of https://github.com/dotnet/aspnetcore/issues/53129
Is there an existing issue for this?
Describe the bug
I have Login.razor page(
@page "/login"
) with InteractiveServer Render Mode. There is a<form>
on this page withmethod="post"
,@formname="uniqueFormName"
andaction="login/submit"
(@page "login/submit"
with Static SSR mode). On submitting this form I get an error on page login/submit.Expected Behavior
Login.razor page with InteractiveServer Render Mode(cause I need some interactivity on this page), and LoginSubmit.razor page with static SSR to process a post request from form on login page.
Steps To Reproduce
Login.razor
LoginSubmit.razor
App.razor
Exceptions (if any)
The POST request does not specify which form is being submitted. To fix this, ensure <form> elements have a @formname attribute with any unique value, or pass a FormName parameter if using <EditForm>.
.NET Version
8.0.302
Anything else?
No response