asp.net - Using @html.label in list a of classes -
i trying follow :
@{ viewbag.title = "administrator"; } @model list<myproject.dal.myclass> @foreach (var m in model) { @html.labelfor(m=>m.id) }
myclass :
namespace myproject.dal { using system; using system.collections.generic; public partial class myclass { public int id { get; set; } public string title { get; set; } } }
how can make @html.labelfor work in case (list of myclass)? if model class @html.labelfor(m=>m.id)
works
this should it.
@model list<myproject.dal.myclass> @foreach (var item in model) { @html.labelfor(m => item.id) }
Comments
Post a Comment