为什么我不能在下面的代码中使用强类型助手?
@using ISApplication.Models
@model IEnumerable<PersonInformation>
@foreach (PersonInformation item in Model)
{
@Html.LabelFor(model => model.Name) // Error here.
@item.Name // But this line is ok
@* and so on... *@
}
错误信息是
The type of arguments for method '...LabelFor<>... ' cannot be inferred from the usage. Try specifying the type arguments explicitly.
有任何想法吗?谢谢。