Question

ASP.NET MVC 2, gives a good functionality of annotation based validation, but to use this functionality I need to reference two files (Microsoft.Web.Mvc.ModelBinders.dll and System.ComponentModel.DataAnnotations.dll) as described here

I use LINQ2SQL, to create my entities. And it uses it's own annotations within Entity classes, which needs another version of System.ComponentModel.DataAnnotations.dll

So currently I'm able to use one of them (either validation or linq2sql) Does anyone encountered same problem? Or does anyone know how to solve this problem?

Was it helpful?

Solution

What you need to do is create MetaData classes for the fields that you want to valdiate,

http://www.asp.net/learn/mvc/tutorial-39-cs.aspx (Using Data Annotation Validators with the Entity Framework)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top