I generate my views genericly with reflection so I am wondering if it is possible to get the validation attributes for all the properties of a class and then make them show in the view if there is a violation
For example:
public class Person
{
[Range(0,300)]
[Required(ErrorMessage ="Please provide a weight")]
public double Weight { get; set; }
}
Aucun commentaire:
Enregistrer un commentaire