Anyone got any idea on how to specify text when using Html.LabelFor(c=>c.MyField). It’s just MyField might not be an appropriate name to display on screen, you may want “The Super Fantastic Field” instead, but there doesn’t appear to be any overloads.
Any ideas?
You use
System.ComponentModel.DataAnnotations.DisplayAttribute:Setting the
ResourceTypeproperty on your attribute will allow you to use a resource file.(Prior to .NET 4 use
System.ComponentModel.DisplayNameAttributewith the caveat that the display name must be a compile-time constant.)