@Html.EditorFor(model => model.Screen.Descri开发者_如何学Cption)
How to add a class or some other attributes to the generated input?
The built-in editor template is too generic (it can display arbitrary objects) for such a concept to make sense. You could either
- Write your own editor template
If it's only a single property you're displaying you could use a more specific helper method such as
Html.TextBoxFor()
:@Html.TextBoxForm(m => m.Screen.Description, new { @class = "myClass" })
精彩评论