MVC data annotations range validation not working properly

随声附和 提交于 2019-11-30 11:22:18
Colin

I had this exact problem and found the solution here. You need to upgrade the following:

jQuery Validation (at least 1.11.1)
Microsoft jQuery Unobtrusive Validation (at least 2.0.30116.0)
Microsoft jQuery Unobtrusive Ajax (at least 2.0.30116.0)

The problem was introduced by breaking changes in jQuery 1.9.1

Try [Range(0, 100)]. Remove ErrorMessage completely to see that you not breaking anything with wrong formatting and curly brackets.

If pure range doesn't work properly let force (MS) be with you! :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!