C# 用于在表中显示复选框的编辑器模板
我有一个编辑器模板,在表中显示复选框。使用下面的代码,所有复选框都将显示在一行上。有人能建议如何每行显示三个复选框吗 编辑器模板C# 用于在表中显示复选框的编辑器模板,c#,asp.net-mvc,asp.net-mvc-3,mvc-editor-templates,C#,Asp.net Mvc,Asp.net Mvc 3,Mvc Editor Templates,我有一个编辑器模板,在表中显示复选框。使用下面的代码,所有复选框都将显示在一行上。有人能建议如何每行显示三个复选框吗 编辑器模板 @model AssignedBusAreaData @using MOC.ViewModels <td> @Html.HiddenFor(model => model.BusinessAreaID) @Html.CheckBoxFor(model => model.Assigned) @Html.Displa
@model AssignedBusAreaData
@using MOC.ViewModels
<td>
@Html.HiddenFor(model => model.BusinessAreaID)
@Html.CheckBoxFor(model => model.Assigned)
@Html.DisplayFor(model => model.BusinessAreaName)
</td>
@型号分配的总线区域数据
@使用MOC.ViewModels
@Html.HiddenFor(model=>model.BusinessAreaID)
@CheckBoxFor(model=>model.Assigned)
@DisplayFor(model=>model.BusinessAreaName)
查看
<div class="editor-label">
@Html.LabelFor(model => model.BusinessAreas)
</div>
<div class="editor-field">
<table>
<tr>
@Html.EditorFor(model => model.BusinessAreas)
</tr>
</table>
</div>
@LabelFor(model=>model.BusinessAreas)
@EditorFor(model=>model.BusinessAreas)
试试这个
<table>
<tr>
<td>
@Html.HiddenFor(model => model.BusinessAreaID)
@Html.CheckBoxFor(model => model.Assigned)
@Html.DisplayFor(model => model.BusinessAreaName)
</td>
</tr>
</table>
@Html.HiddenFor(model=>model.BusinessAreaID)
@CheckBoxFor(model=>model.Assigned)
@DisplayFor(model=>model.BusinessAreaName)
看法
@LabelFor(model=>model.BusinessAreas)
@EditorFor(model=>model.BusinessAreas)
是业务区
分配的业务区数据的集合?谢谢您。但似乎所要做的就是在另一个表中为每个复选框嵌套一个表。
<div class="editor-label">
@Html.LabelFor(model => model.BusinessAreas)
</div>
<div class="editor-field">
<table>
<tr>
<td>
@Html.EditorFor(model => model.BusinessAreas)
</td>
</tr>
</table>
</div>