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

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -