How to use data annotations for drop-down lists?

Viewed 20485

In MVC3 data annotations can be used to speed up the UI development and validations; ie.

    [Required]
    [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
    [DataType(DataType.Password)]
    [Display(Name = "New password")]
    public string NewPassword { get; set; }

However, if for a mobile app, there is no field label, only a drop-down list populated from the database. How would I define this in this way?

    [Required]
    [DataType(DataType.[SOME LIST TYPE???])]
    [Display(Name = "")]
    public string Continent { get; set; }

Is it better not to use this method for this?

2 Answers
Related