ASP.NET MVC 2 and ComponentModel.DataAnnotations Validation: minimum value attribute


ASP.NET MVC 2 and ComponentModel.DataAnnotations Validation: minimum value attribute



I'm decorated a ViewModel in my ASP.NET MVC 2 site with System.ComponentModel.DataAnnotations validation attributes. For one of my fields, named Price, I want to validate that the value is not below some extent, in this case 0.

I know that RangeAttribute exists for validation with a lower and an upper extent, but does something like a MinimumValueAttribute exist for validation with only a lower extent?

If not, I guess I'll just roll my own.


linq to sql joining two table

1:

Inserting markup into hidden jqGrid column
before you roll your own - try [Range(0.05, Double.MaxValue)]. MVC make action link perform a submit
asp.net mvc int property bind exceptionHow do I pass a list of integers to an MVC action?

2:

MVC.net form post/anti forgery
Not sure if RegularExpression is the "best" solution, although you must commit it a shot. MVC - Changing or adding a class for either 'Html.ValidationMessage' or 'Html.TextBox'
"^\$?\d+(\.(\d{2}))?$" 
Should my ViewModel's constructor populate the ViewModel's data?

53 out of 100 based on 23 user ratings 383 reviews

#