Reputation: 6762
I am trying to get Display Name attributes in a model and display them in a loop. I am able to get Property name but unable to pull displayName attributes. Any help on logic would be highly appreciated. I tried debugging, adding watch to Model.GetType() and could not trace out attributes part.
@foreach (PropertyInfo propertyInfo in Model.GetType().GetProperties())
{
<li>
<div>
@propertyInfo.Name
</div>
</li>
}
Upvotes: 0
Views: 283