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.43k stars 10.01k forks source link

Permit to validate only selected objects binded with [BindProperty] for use with different forms in a single RazorPage #37606

Open tmm360 opened 3 years ago

tmm360 commented 3 years ago

How is well described in this question https://stackoverflow.com/questions/48516547/how-to-implement-two-forms-with-separate-bindproperties-in-razor-pages would be useful to be able to have different input models with different bindings for each form in a single RazorPage.

Currently ModelState property validate all models together, but for each form is desirable that only related model is validated. Otherwise having others unmanaged models will lead to have ModelState.IsValid == false for each request asking for validation.

Is your feature request related to a problem? Please describe.

I'm trying to validate only selected binded models when I execute a query on a RazorPage having different forms and different binded models.

Describe the solution you'd like

I'd like to have a simple way for validate only selected models, something like ModelState.IsValid(MyBindedProperty).

ghost commented 3 years 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.

captainsafia commented 3 years ago

Triage: Backlogging this and marking as enhancement to gather feedback on interest in this feature.

tmm360 commented 3 years ago

I believe that can have multi forms in a single page is a fundamental feature for RazorPage.