DCSIMG
Client-side Validation using ASP.net Dynamic Data? - urig - Tidbits from a .net life

Client-side Validation using ASP.net Dynamic Data?

Published 14 May 08 08:54 PM | urig

I've just finished listening to my first ever podcast (I know, I know). It was the "Phil Haack on Model View Controller" episode of ".Net Rocks!" and I enjoyed listening to it very much.

The episode is focused on ASP.net MVC, yet near the end Phil brings the new ASP.net Dynamic Data technology into the picture - surprisingly enough, in the context of validating data of the client-side.

Phil suggests that the Dynamic Data feature of using attributes on (or next to) the data model to hint at how data is to be rendered, might, in the future, be used to indicate how the data is to be validated. These hints might be read by the view and parsed into client-side validation code.

What I'm reading between Phil's lines is that validation could end up being extended into the client-side of things automagically!

The idea of using attributes on the data to enforce its validation is not new, but every implementation I've seen so far, has fallen short of crossing one critical boundary - the leap from server-side validation to client-side validation. If you want to have some of your validation happen on the client-side, for usability's sake, you always end up duplicating some of your validation code.

This is the first time I've heard of anyone in Microsoft (or anywhere) "picking the ball" on what, to me, is a kind of holy grail. I hope it's not a case of hearing what I want to hear and that we might see this budding in the future previews of .Net 3.5 Extensions. Go get'em Phil!

Comments

No Comments