0

I have this class and would like to display user friendly names. How to do it?

public static class NavigationRoles
{ 
    [Display(Name = "Structure d'offre de service")]
    public const string STRUCTURES = "STRUCTURES";
}

Trying this @Html.DisplayNameFor(m => NavigationRoles.STRUCTURES) in my view returns an InvalidOperationException: Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.

Bellash
  • 7,560
  • 6
  • 53
  • 86

0 Answers0