The Validation Application Block included in Enterprise Library 4.0 is a really cool block. I firstly tried to find the RequiredFieldValidator equivalent to ASP .NET. The fact is in the VAB there is only a StringLengthValidator which can be used for this task. There is a possibility to bend this validator to act exactly like the ASP .NET RequiredFieldValidator does.
Configure a ‘RequiredFieldValidator’ with Validation Application Block
1. Use the Configuration Utility to add a StringLengthValidator and rename it to ‘Required Validator’.
2. Configure the StringLengthValidator like in the following way.
You can add an addtional StringLengthValidator to validate for the max length of the string.