@model IEnumerable<CustomEntity>
@{
ViewBag.Title = "Index";
}
@Html.DisplayForModel()
and then make sure that your display template is stored in ~/Views/Shared/DisplayTemplates/CustomEntity.cshtml
. Notice that the location and the name of the display template is very important. It should be called the same way as the type (CustomEntity.cshtml
) and should be located either in ~/Views/Shared/DisplayTemplates
or you could also override it in ~/Views/XXX/DisplayTemplates
where XXX
is the controller that rendered the main view.