Model client validation css styles not work well with @Html.EditorFor
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
### Describe the bug
If use `@Html.EditorFor` with the expression for a property, client-side validation will display error message with wrong css style.

***The `class` attribute has no value***

### To Reproduce
```
@for (var i = 0; i < Model.TestChildModels.Count; i++)
{
@Html.EditorFor(model => model.TestChildModels[i])
}
```
_**_EditorTemplate/TestChildModel.cshtml_**_
```
@model TestChildModel
```
**The workaround I am using now**
_add following code snippet in `site.css`_
```
span.field-validation-error span {
color: red;
}
```
### Further technical details
- ASP.NET Core version 5.0
Contributor guide
Assessment
This issue has not been assessed yet.