I briefly mentioned this 3rd party tool once before, but as I'm using it daily and for the last 4 months, I wanted to post more on it. (Note: I'm just doing this 'cause I dig it. I'm not meaning to sound like a shill, but you know me, if it's cool, I tell you. If it sucks, I say it loud.)
Every once in a while you come upon some cool controls for ASP.NET that you just have to spread the word. Andy Smith's stuff is like that, you know, and now he works with Robert McLaws at Interscape. Just clever, simple, elegant and few moving parts. When I find a set of controls that give me elegant and powerful functionality I typically RIP them apart to find out how they did it and how I can learn from them.
So the fellow I want to talk about is Peter Blum, and the ASP.NET Toolkit is the Validation and More package.
Then, the actions are abstracted from the formatters. Basically the fact an error occured is SEPARATE from how that error's message will express itself. So, you might have a string "Please enter a valid Social Security Number" but that can be presented as an Alert Box, a DHTML layer, a tiny gif with an ALT tag tooltip, a colored textbox, or a flashing graphic (or whatever you want). Separating activities from presentation from storage... it's "3 tiered" design within a replacement validation framework. It's so crazy it just might work. :)
Localization (So few people care...but everyone should)
There's a LOT (most?) of ASP.NET controls out there that just assume that everyone in the world speaks English (or cares to). I've picked up a few Calendar controls from random places that literally crashed when told to display a different culture.
We have banks live in such out of the way places as Greece, Thailand, and Malaysia. We need our systems and ASP.NET controls to be fully "culture smart." (PLUG: Come see my Internationalizing ASP.NET Sites at VSLive!) The VAM validation controls support using ResourceID strings for complete localization of Error Messages. This culture awareness is throughout the framework, and it's appreciated as I work on banks en español.
One cool extra is a concept called a FieldStateController. From the site:
"The FieldStateController controls can monitor edits and clicks on any type of field on the page. They can use the same Conditions used by validators to determine if a certain condition is met before taking their action. For example, the checkbox must be checked, the textbox must contain some text, or the listbox must have a selection."
There's a great (and incredibly long) Developer's Guide that explains how you can extend the framework. For example, I wanted to support entering dates like this "YYYYMMDD" as well as the standard culture-specific "MM/DD/YYYY". So, I derived from the existing PeterBlum.DateTypeConverter my own CustomScottDateTypeConverter. It's one class that handles both server and client side validation/conversion. I added code to handle my new "DataType" and delegated the rest to the base class. No need to reinvent the wheel.
There's also a bunch of freebee features that aren't neccessarily validation related, but are useful to your application.
- There's a "TrueBrowser" object model that lets you sniff browser capabilities more easily than the standard BrowserCaps stuff.
- There's a FilteredTextBox to limit keystrokes to just decimals, currency or integers.
- LocalizedLabels - smart string lookup labels for multi-lingual sites.I know
Documentation (When it's good, OH it's good.)
His documentation is obscene. Like, it's embarassing. No single developer should write this much documentation. You'd think there's a separate documentation department. Probably he's locked his mom in the garage and got her making PDFs. I mean that in the best way. Except, he's put me in a bad spot...if I ever start my own company, I need to have doc at least this good...and I'm not sure I want the bar set that high.
We had to call support with a CRAZY threading bug in our 1.02 version of the VAM that happened if two people with the identical browser hit the site within a few milliseconds of each other if that browser has never hit the site before and the site is under exteme load. (This happened twice in a week, so you get the idea that it's was obscure and not a big deal.) Anyway, I explained it to Peter and he had already found and fixed it for the next minor version!
He's got two pricing levels of VAM, and Level 2 (the one that includes all the good stuff) is only $100 and even the Redist or Source Code License is reasonable. That's insane. Anyway, check it out. It's SO rich and SO powerful that it may freak you out as it's overwhelming. Seriously, take a day and spend time with it. Read the instructions, and read them again.
The real value for me is that we are using it's extensibility points to extend it WELL beyond it's standard features and firmly into the Financial Vertical I work in. We've extended and added to the point where it's now the Corillian Validation Framework, and that's just great for us...our job isn't to write validation code, it's to make powerful banking sites. And that suits me just fine. Microsoft should buy this guy and integrated the whole thing into ASP.NET 2.x.