0

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; }
3
  • This is not html5 question. Please, add the correct tag (Java, .NET, etc) Commented Feb 11, 2016 at 15:53
  • Fixed sorry, data attributes are html5 which is why I added it. Commented Feb 11, 2016 at 15:53
  • Ok, no problem. I came here to help you but I don't know anything about C#. I can help you with javascript or php Commented Feb 11, 2016 at 15:55

1 Answer 1

2

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]

Sign up to request clarification or add additional context in comments.

Comments

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.