使用ASP.NET MVC4应用程序验证应用程序块

时间:2013-04-30 17:52:59

标签: .net asp.net-mvc asp.net-mvc-4 enterprise-library

我想在我的ASP.NET MVC4应用程序中使用企业库验证应用程序块。建议使用哪个版本的Enterprise Library? 任何人都可以为VAB for ASP.NET MVC4提供XML配置文件的示例吗?

我在MSDN网站上找到了一个使用ASP.NET的示例:http://msdn.microsoft.com/en-us/library/ff664564(v=pandp.50).aspx 它是否也适用于MVC4应用程序?

1 个答案:

答案 0 :(得分:0)

VAB属性是DataAnnotations,因此它们可以与MVC一起使用。或者,如果要将VAB用作验证引擎,则可以为Enterprise Library创建ModelValidatorProvider。 消息来源:Entlib Official Site Discussion Forum