I have a list of items that I am passing to a view. I would like to render each item using a display template. However, something is wrong, as I don't get the field properly rendered. Here is my main view (Index.cshtml):
@model IEnumerable<CustomEntity>
@{
ViewBag.Title = "Index";
}
@Html.DisplayFor(m=>m)
Here is my display template:
@model CustomEntity
<div>
@Html.LabelFor(m=>m.Name):
<strong>@Model.Name</strong>
@Html.LabelFor(m=>m.Icon):
<strong>@Model.Icon</strong>
@Html.LabelFor(m=>m.TypeName):
<strong>@Model.TypeName</strong>
</div>
The page loads, but doesn't display the values of the entity.