Tsukasa
Tsukasa

Reputation: 6552

MVC Model Data Attributes

So in my view I can add data-XXX but can I do this in the Model instead of having to add the code to the view? Something like this or another way to do it

[data-input-mask('99/99/9999')]
public string SomeDate { get; set; }

Upvotes: 0

Views: 109

Answers (1)

user5911118
user5911118

Reputation:

The most complete solution is to create your custom attribute, as explained in the following post

[http://www.codeproject.com/Tips/642477/Input-Masking-in-MVC-using-Data-Annotation][1]

Upvotes: 2

Related Questions