Validation in ASP.NET MVC – part 4: example with server-side and client-side validation

This is part 4 of a series of posts. See also:

In the previous posts, I described how we implemented model-based validation on the server-side in Cuyahoga with ASP.NET MVC and as the icing on the cake, we also added some client-side validation (also model-based).

Now, everything can be found in the Cuyahoga SVN sources but I have to agree that it can be a daunting task to check out the complete sources and find all pieces of the validation puzzle. Therefore, I’ve created a little sample application with everything from the previous posts combined.

validation-sample-app

Hopefully, this will make things a little bit clearer. You can download the sample app here. Visual Studio 2008 and ASP.NET MVC Beta are required.

Enjoy!

No Trackbacks

3 Comments

  1. cypher

    Thanks for submitting this sample.
    Very helpful.

    Cheers.

    Posted January 2, 2009 at 1:08 pm | Permalink
  2. cypher

    I don’t clearly understand it all, but as far as I know, you declare/add "options" (in AddParameterToOptions()), but never output them as Javascript (in CreateBeforeFormClosed()).

    My two cents.

    Posted January 2, 2009 at 1:57 pm | Permalink
  3. martijn

    Those options were just copied from the Monorail JQuery validator and as far as I can see, you could remove these.

    Posted January 2, 2009 at 2:07 pm | Permalink