Get DisplayName Attribute without using LabelFor Helper in asp.net MVC

后端 未结 3 2065
说谎
说谎 2020-11-29 19:47

What is the best way to retrieve the display name attribute for an item in your model? I see a lot of people using the LabelFor helper for everything, but a label isn\'t app

3条回答
  •  Happy的楠姐
    2020-11-29 20:11

    You should try new existing function :

    <% Html.DisplayNameFor(m => m.YourProperty) %>
    

提交回复
热议问题