Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 用于在表中显示复选框的编辑器模板_C#_Asp.net Mvc_Asp.net Mvc 3_Mvc Editor Templates - Fatal编程技术网

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>