Validation Application Block and PropertyProxyValidator

 I had some trouble validating date input using VAB and the PropertyProxyValidator.  As I would think would be the norm, for a date that I have specific requirements on, I'll setup a NotNullValidator, along with a DateRangeValidator to make sure the date fits within a certain range.  But I was getting errors because the PropertyProxyValidator was tied to a TextBox control, which means that the underlying value is a string.  Because it's a string, it couldn't be validated against.

The ValueConvert event fires whenever a server-side validation occurs (which is the mode that it works in), allowing you to convert the value to an alternative format.  This allowed me to convert the date from a string to a DateTime reference, and this solved the problem.

Comments

No Comments

The leading UI suite for ASP.NET - Telerik radControls
Outstanding performance. Full ASP.NET AJAX support. Nearly codeless development.