Tonight I have another small update for my MVC Validation Extensions. This update adds another attribute:
- RequiredIfEmpty
Example Usage
public string RequiredIfEmptyControl { get; set; } [RequiredIfEmpty("RequiredIfEmptyControl")] public int? MightBeRequired { get; set; }
This new control will require the field if the other property is empty. Please note that whitespace is considered empty in this case.
For more details and examples head on over to the MVC Validation Extensions project page or head on over to nuget and download the updated package. Last but not least I am in the middle of getting the extensions ready to work with ASP.Net 5!