Project Description

This project started with the goal of learning how to do validation in ASP.NET MVC 2 using Ajax to simulate client-side validation without the need for wiring up all of the client-side validation scripts... it simply derives the server response and makes it appear cleanly on the client-side. Ajax makes it feel smooth, if not as crisp as client-scripted validation, it still avoids a visual form postback.

The theory on why this project makes sense is twofold... first of all, wiring the intricacies of client-side validation is difficult... custom validators have to be bound to a client-side validation framework, extended, methods added, etc. Also, it's just somehow nice to only worry about the server-side, and just have client-side "work" (and server-side obviously matters the most in the end, since it's the last check-point for data). Secondly, there is a lower script overhead per page-load which may offset the burden of the Ajax form post. That remains to be seen, but if the number of incorrect form submissions multiplied by the bandwidth of the Ajax form submission is less than the total scripts that didn't have to be loaded to support client-side validation multiplied by EVERY page load... then this theory could be very valid--even a bandwidth savings on the whole... TBD.

This example also demonstrates variable length list validation (including adding to, removing from, and sorting a variable length list on the client-side) which is handy. The goal of this project is to kick around ideas to make complex MVC validation as simple as possible...

Track the full discussion here: http://forums.asp.net/p/1604857/4091382.aspx

The first project using this approach is now live at http://www.getfrontdesk.com ... note that I've recently made the full project using this concept open source--check out "Frontdesk" on the related projects! :)

At this stage, the project is working across all the major, current browsers, and is starting to include some derivatives of the jQuery validationengine visual approach to validation messages. More to come...

Last edited Jun 27, 2011 at 7:34 PM by jondjenkins, version 9