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
Post a Comment