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" />
1
  • Only by creating your own HtmlHelper extension methods. Refer this answer for an example. Commented Jul 12, 2016 at 22:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.