我们如何在MVC4中使用错误消息在模型中应用验证 [英] How We can Apply Validation in Model in MVC4 with Error Message

查看:69
本文介绍了我们如何在MVC4中使用错误消息在模型中应用验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想使用Model.Hi进行验证我可以使用Visual Basic验证我的页面使用模型验证。

解决方案

< blockquote>这是你使用MVC模型(服务器端)添加验证的方法

http://www.asp.net/mvc/overview/older-versions/getting-started-with-aspnet-mvc4/adding-validation-to -the-model [ ^ ]



如果你想用JavaScript(客户端)使用它这个jQuery验证插件:

http://jqueryvalidation.org/ [ ^ ]


Hi All,
I want to make validation using Model.Hi I can Validate My Page Using Model Validations Using Visual Basic.

解决方案

This is how you add validation using MVC Model (Server Side)
http://www.asp.net/mvc/overview/older-versions/getting-started-with-aspnet-mvc4/adding-validation-to-the-model[^]

and if you want to do it using JavaScript (client side) use this jQuery validation plugin:
http://jqueryvalidation.org/[^]


这篇关于我们如何在MVC4中使用错误消息在模型中应用验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆