I have this model:
public class DefinitionListModel : List<DefinitionListItemModel>
{
}
Then I have this display template (partial view) setup for it in DisplayTemplates:
@model Company.Product.Models.DefinitionListModel
<dl>
@foreach (var definition in Model)
{
Html.DisplayFor(m => definition);
}
</dl>
Which calls this default display template because each item is a DefinitionListItemModel
:
@model Company.Product.Models.DefinitionListItemModel
@Html.DisplayFor(m => m.Term, "DefinitionTerm");
@Html.DisplayFor(m => m.Description, "DefinitionDescription");
And the DefinitionTerm
template looks like this:
@model object
@{
if (Model != null)
{
string s = Model as string;
if (s != null)
{
<dt>@s</dt>
}
else
{
// Other types and models that could be used.
// Last resort.
<dt>@Model.ToString()</dt>
}
}
}
A breakpoint placed in the last template is hit successfully and the view and mark-up appears to run through just fine, but none of it renders, not even the DL tag from the first template above.
Why does it hit breakpoints but not render any HTML?