ASP.net MVC 3.0通用验证方法
我刚刚学习 MVC 3.0,ValidationMessageFor
效果很好,但其中每一个都附加到特定的用户输入。
我将如何创建一般验证错误?
IE:多个字段的总和应为 100。每个字段单独的可能范围为 0-100,但组合起来也不应超过 100。
我想通知用户此错误。
I'm just learning MVC 3.0 and ValidationMessageFor
works great, but each one of those is attached to a specific user input.
How would I go about creating a general validation error?
I.E.: A number of fields are supposed to add up to 100. Each one individually has a possible range of 0-100, but combined should also not cross 100.
I want to notify the user of this error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您始终可以像这样手动插入一条记录:
当您使用时
它会显示出来。
You can always insert a record manually like so:
When you use
It will show up.