【发布时间】:2016-12-10 04:24:58
【问题描述】:
我有一个模型:
public class MyListModel
{
public int ID {get;set;}
public List<User> Users{get;set;}
}
如何在 foreach 中使用 Html.EditorFor 方法?
@model MyListModel
<table>
<tr>
<th></th>
</tr>
@foreach (var item in Model.Users) {
<tr>
<td>
@Html.EditorFor(item.Enabled)
</td>
</tr>
}
</table>
【问题讨论】:
标签: asp.net-mvc mvc-editor-templates