Adding style to Editor For

前端 未结 5 1105
独厮守ぢ
独厮守ぢ 2020-12-18 21:48

I\'m trying to apply a Style to the Editor for an element, but I can\'t make it work; what am I doing wrong?

@Html.EditorFor(model => model.ClienteNuevo)
         


        
5条回答
  •  北荒
    北荒 (楼主)
    2020-12-18 22:16

    EditorFor does not allow for styling as there are no parameters for additional attributes. The reason for this is because the EditorFor doesn't always generate a single element as it can be overridden. To style a specific type of element you need to use the specific editor you want to use. For instance if the editor is a textbox just use TextBoxFor and apply the styling that way.

提交回复
热议问题