ASP.NET MVC 3 Custom Display Template With UIHint - For Loop Required?
问题 If i have a ViewModel like this: public class MyViewModel { [UIHint("SomeTemplate")] public ICollection<SomeViewModel> Submodel { get; set; } } And a strongly-typed View with a line of HTML like this: @Html.DisplayFor(model => model.Submodel) And a display template with a signature like this: @model MvcApplication1.Models.SomeViewModel I get an error saying "the model item is of type List<SomeViewModel> but this dictionary requires a model of type SomeViewModel .". Which makes sense, but i