dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.36k stars 9.99k forks source link

Provide a new form component to simplify form authoring #49653

Open danroth27 opened 1 year ago

danroth27 commented 1 year ago

When I tried to implement a logout form, this is what I ended up with:

<form method="post" @onsubmit="Logout" @formname="logout">
    <button type="submit">Logout</button>
    <AntiforgeryToken />
</form>

It didn't make sense to use EditForm for this form because EditForm requires a model or an edit context, which I don't really need.

A couple of observations:

In Razor Pages the form tag helper handles these concerns for you:

<form asp-page="/Identity/Account/Logout" method="post" >
    <button type="submit">Logout</button>
</form>

Should we provide a new framework component that makes authoring these sorts of forms easier?

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

Bartmax commented 1 year ago

Also I find impossible to submit a normal (not enhanced) form post now (for example for cookie auth) in RC1.

danroth27 commented 1 year ago

Also I find impossible to submit a normal (not enhanced) form post now (for example for cookie auth) in RC1.

Hi @Bartmax. This sounds like something we should investigate. Could you please open a new issue for this with details on how to reproduce the issue?

Bartmax commented 1 year ago

Hey @danroth27, the issue of not able to do a normal (full page) post in a form on RC1 (without turning the whole thing off) is already taken care on RC2 with a way to individually opt-in/opt-out of enhance navigation on forms/links.

I still do find that solution problematic, so I did open an issue for that here https://github.com/dotnet/aspnetcore/issues/50887

ghost commented 10 months ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.