views:

445

answers:

1

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?

+4  A: 

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)

Pino