How get a property display name using DisplayNameFor()
to build a table header. for instance:
@model IEnumerable<Item>
<table class="table">
<thead>
<tr>
<td>@Html.DisplayNameFor(? => ?.prop1)</td>
<td>@Html.DisplayNameFor(? => ?.prop2)</td>
<td>@Html.DisplayNameFor(? => ?.prop3)</td>
</tr>
</thead>
<tbody>
@foreach (Item item in Model) {
<tr>
<td>@Html.DisplayFor(i => item.prop1)</td>
<td>@Html.DisplayFor(i => item.prop2)</td>
<td>@Html.DisplayFor(i => item.prop3)</td>
</tr>
}
</tbody>
</table>
what should I write in the question marks?