Skip to content

ValidationSummaryTagHelper for prefix only #4928

Closed
@wutever0

Description

@wutever0

Is this a Bug or Feature request?:

Feature Request

Steps to reproduce (preferably a link to a GitHub repo with a repro project):

1 - Sometimes you have two forms on the page, each one submitted to a different action. e.g. a LoginRegister page split into two with a form for Login and another form for Register.
2 - Each action would be model-binded to a separate form model. e.g. LoginFormModel and RegisterFormModel
3 - Each form would have a Validation Summary

Description of the problem:

1 - If the form being submitted is invalid, the Validation Summary of both forms would include the validation error messages.
2 - There is no way of setting the Validation Summary to display messages for only the fields in its form or to display error messages only for model keys with a specific prefix (e.g. "Login" or "LoginFormInput" )

Version of Microsoft.AspNetCore.Mvc or Microsoft.AspNetCore.App or Microsoft.AspNetCore.All:

Microsoft.AspNetCore.App version is v2.1.1

Metadata

Metadata

Assignees

Labels

area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesenhancementThis issue represents an ask for new feature or an enhancement to an existing one

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions