Two issues to address:
1. Default collection and complex object editor templates ignore the "htmlAttribute" key in view data. This causes consistent application of `@Html.EditorFor(… , new { htmlAttribute = new { @class = "form-control" } })` for all properties of the following model:
``` C#
public class Higher
{
public int Id { get; set; }
public string HName1 { get; set; }
public Middle HValue { get; set; }
public string HName2 { get; set; }
}
```
to result in inconsistent HTML -- some `<input/>` elements with the requested class, some without. See attached InconsistentHtml.png file for the visible effect of this inconsistency.
2. The name of the view data key in `@Html.EditorFor(... , new { htmlAttribute = new { @class = "form-control" } })` is inconsistent with the very similar parameter name in (for e.g.) `@Html.TextBoxFor(... , htmlAttributes: new { @class = "form-control" })`. Rename the view data key to make it also plural -- "htmlAttributes".
1. Default collection and complex object editor templates ignore the "htmlAttribute" key in view data. This causes consistent application of `@Html.EditorFor(… , new { htmlAttribute = new { @class = "form-control" } })` for all properties of the following model:
``` C#
public class Higher
{
public int Id { get; set; }
public string HName1 { get; set; }
public Middle HValue { get; set; }
public string HName2 { get; set; }
}
```
to result in inconsistent HTML -- some `<input/>` elements with the requested class, some without. See attached InconsistentHtml.png file for the visible effect of this inconsistency.
2. The name of the view data key in `@Html.EditorFor(... , new { htmlAttribute = new { @class = "form-control" } })` is inconsistent with the very similar parameter name in (for e.g.) `@Html.TextBoxFor(... , htmlAttributes: new { @class = "form-control" })`. Rename the view data key to make it also plural -- "htmlAttributes".