I have a model class, with a property like this:
[Display(Name = \"Phone\", Description=\"Hello World!\")]
public string Phone1 { get; set; }
In addition to Jakob Gade'a great answer:
If you need to Support a DescriptionAttribute instead of a DisplayAttribute, his great solution still works if we override the MetadataProvider:
public class ExtendedModelMetadataProvider : DataAnnotationsModelMetadataProvider
{
protected override ModelMetadata CreateMetadata(IEnumerable attributes, Type containerType, Func
This need to be registeres in the Application_Start Method in Global.asax.cs:
ModelMetadataProviders.Current = new ExtendedModelMetadataProvider();