Posts

Showing posts from July, 2009

Enterprise Library Valiators - beware of lowerBoundType in StringLengthValidator

I was using StringLength Validator provided by Enterprise Library Validation Block (integration with ASP.NET). I started with attributes based validation specification -: [StringLengthValidator(2, 10)] public string Name { get{} set{} } and it worked fine. It gave validation warning when string of length 1 is entered in the ASP.ET text box. Later I removed these attributes and moved this validation to xml file (for the corresponding business class and RuleSet "A" and "A" is the default ruleset): messageTemplateResourceName="" messageTemplateResourceType="" tag="" type="Microsoft.Practices.EnterpriseLibrary.Validation.Validators.StringLengthValidator, Microsoft.Practices.EnterpriseLibrary.Validation, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null" name="String Length Validator" /> Suddenly, my validations stopped working. There was no validation error when I used string of length = 1 . The first suspect was ...