I have the following code:
@{
var add = new System.Dynamic.ExpandoObject();
var attr = new System.Dynamic.ExpandoObject();
((IDictionary<string, object>)attr)["class"] = "form-control";
((IDictionary<string, object>)add)["htmlAttributes"] = attr;
}
@Html.EditorFor(model => model.FirstName, add)
However in the resulting HTML markup, the class "form-control" is not present.
What am i missing or does EditorFor just not work with dynamic objects?
Go to the complete details ...