You can create your own validator like this:
public class RequiredGreaterThanZero : ValidationAttribute
{
/// <summary>
/// Designed for dropdowns to ensure that a selection is valid and not the dummy "SELECT" entry
/// </summary>
/// <param name="value">The integer value of the selection</param>
/// <returns>True if value is greater than zero</returns>
public override bool IsValid(object value)
{
// return true if value is a non-null number > 0, otherwise return false
int i;
return value != null && int.TryParse(value.ToString(), out i) && i > 0;
}
}
Then "include" that file in your model and use it as an attribute like this:
[RequiredGreaterThanZero]
[DisplayName("Driver")]
public int DriverID { get; set; }
I commonly use this on dropdown validation. Note that because it's extending validationattribute you can customize the error message with a parameter.