i want add custom attributes input generated @html.editorfor, tried following:
@html.editorfor(model => model.percent, new { @class = "percent" }) but ignores class, can tell searching around template doesn't support adding custom attributes.
but how 1 create custom template adding support custom attributes, while keeping functionality of old template?
please see following posts, question has been asked before on stackoverflow.
- add css class html.editorfor in mvc 2
- set class attribute html.editorfor in asp.net mvc razor view
- asp.net mvc 3 razor - adding class editorfor
there many more examples, google it.
i hope helps.
Comments
Post a Comment