2

I'm trying to use a Display Template for an IEnumerable collection of an interface, and for some reason I cannot get the Display Template to display for the interface.

Here's some brief code to show you what I mean.

I have ~/Views/Shared/DisplayTemplates/IUserMessage.vbhtml with some trivial view code.

I also have ~/Views/Shared/DisplayTemplates/UserMessages.vbhtml:

@Imports WebUI.UserMessages
@ModelType IEnumerable(Of IUserMessage)
<div id="UserMessages">
    '@Html.DisplayForModel("IUserMessage") 'This doesn't work either
     @Html.DisplayForModel()
</div>

And in ~/Views/Shared/_Layout.vbhtml I have

@Html.DisplayFor(Function(m) m.UserMessages) 'm.UserMessages is List(Of IUserMessage) with a UIHint of "UserMessages"

I step through the code, and it gets into the UserMessages display template just fine. However, the code never reaches the IUserMessage display template.

emkayultra
  • 398
  • 3
  • 15

0 Answers0