Tonight I’ve released a small update the MVC Validation Extensions. In this updated I’ve added a new validation attribute:
- RequiredIfValue
This attribute will cause the property to be required only if the value of the other property is equal to the specified value.
Example Usage
[RequiredIfValue("RequiredIntControl", "15")] public int? SomeRequiredIfValue { get; set; }
In this example SomeRequiredIfValue will be required as long as the value of the RequiredIntControl field is equal to 15.
For more details and examples head on over to the project page or head on over to nuget and download the updated package.