views:

14

answers:

1

Hi, how do I deny blank spaces (" ") using Enterprise Library validation?

[StringLengthValidator(1, RangeBoundaryType.Exclusive, 100, RangeBoundaryType.Inclusive)] 

allows them.

Thanks.

A: 

You could try a regular expression validator:

[RegexValidator("^([ ]+)$", MessageTemplate = "Invalid")]
Darin Dimitrov
Yes, that's an option. I was wondering that maybe there was an attribute for that on EntLib.
JP Araujo