c# - strongly typed helpers inside @model IEnumerable<> -


why not able use typed helpers in code below?

@using isapplication.models @model ienumerable<personinformation>  @foreach (personinformation item in model) {     @html.labelfor(model => model.name) // error here.     @item.name // line ok      @* , on... *@ } 

the error message is

the type of arguments method '...labelfor<>... ' cannot inferred usage. try specifying type arguments explicitly.

any ideas? thanks.

try way. need access name item.

@foreach (personinformation item in model) {     @html.labelfor(x => item.name);      @html.displayfor(x =>item.name)  } 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -