1

Is possible to change the view input class based on a model annotation. for instance:

[required]
[class("phone-class")]
public string Phone {get; set;}

and it would output

<input name="Phone" class="phone-class" />
Daniel Santos
  • 14,328
  • 21
  • 91
  • 174
  • Only by creating your own `HtmlHelper` extension methods. Refer [this answer](http://stackoverflow.com/questions/26519493/customattribute-reflects-html-attribute-mvc5/26519946#26519946) for an example. –  Jul 12 '16 at 22:15

0 Answers0