views:

127

answers:

2

Hi,

There have been plenty of questions on MVC validation but so far the answer has been pretty much inconclusive.

For my needs in particular, I would like something that generates client validation and server validation from the same description and should allow both model based attributes as well as code based declarations for those using an ORM (e.g. LINQ TO SQL) exclusively.

I have seen some validation packs that have been whipped up to do this but they tend to introduce a lot of dependencies or are reasonably incomplete (e.g. no support for check boxes or no "higher-level" validation).

Do we begin writing our own validation framework or do we wait in hope that the team may actually release something now that they have the structure for validation in place and jQuery on board?

For those out there actually using MVC in the field now what are you using for validation?

+1  A: 

Are you aware that validation semantics have been added in preview 5? This article from Scott Gu describes how to use it, and this one details the changes in the beta.

I have not personally used it, and it may not fit all your requirements, but I have no doubt it could be extended to behave like you want.

David Thibault
That's the thing - you have to write your own implementation of the semantics. "they have the structure for validation in place" but there's no implementation for common validation. It's very nice what they have, especially for custom server-side validation, but not for basic typical client/server
Graphain
+1  A: 

The best way as of the released MVC 1.0 is to use xVal.
You may also need to look at this post on implementing Linq2SQL with xVal in case that hasn't been resolved/doesn't work.

Graphain