Brosteins

Developers, Technology Evangelists, Bros.

MVC Validation Extensions 1.1 Released

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.

mvc validation extensions

The RequiredIfValue attribute in action.

For more details and examples head on over to the project page or head on over to nuget and download the updated package.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.