Using ASP.NET MVC v2 EditorFor and DisplayFor with IEnumerable Generic types

Use the attribute [UIHint(“Tags”)] then create a display template called Tags.ascx in the DisplayTemplates folder.

class MyModel 
{
    [UIHint("Tags")]
    IList<Tag> Tags { get; protected set; }
}

And in the file Tags.ascx

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<Tag>>" %>
<!-- put your Model code here -> 

Works for me

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)