xval与MVC 3.0验证 [英] xval vs MVC 3.0 validations

查看:84
本文介绍了xval与MVC 3.0验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人对使用xVal或MVC 3.0模型验证有任何意见?我最初开始使用xVal是因为它具有同时验证客户端和服务器端的能力,但是该项目似乎已经停滞了(也许休眠是一个更好的说法),并且看来MVC 2.0和3.0中的验证已大大改善.与xval相比,使用xval进行MVC3.0验证有什么优势,反之亦然?

I was wondering if anyone has any opinions regarding the usage of xVal or MVC 3.0 model validation? I originally started using xVal because of its ability to validate both client and server side but the project appears to be dead (perhaps dormant is a better word) and it appears that validation in MVC 2.0 and 3.0 has greatly improved. What are the advantages, if any, to using xval over MVC3.0 validation and vice versa?

任何建议都值得赞赏,

谢谢

JP

推荐答案

我认为将xVal用于MVC 3.0与内置支持相比没有任何优势. xVal的创建者甚至在他们的主页上说了这句话: xVal的CodePlex网站:

I think there is no advantage of using xVal for MVC 3.0 over the built-in support. The creators of xVal even say this on their homepage: xVal's CodePlex site:

重要提示:建议使用xVal 仅适用于ASP.NET MVC 1.0

Important: xVal is recommended for use only with ASP.NET MVC 1.0

如果您使用的是ASP.NET MVC 2.0或 后来,该框架已内置 支持生成客户端 直接从模型验证逻辑 元数据.如果仍然可以使用xVal 您希望,但不会积极 开发或支持.

If you're using ASP.NET MVC 2.0 or later, the framework has built-in support for generating client-side validation logic directly from model metadata. You can still use xVal if you wish, but it won't be actively developed or supported.

这篇关于xval与MVC 3.0验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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