这是我的观点,教育是模型中的列表。
@using chpayroll.Models.CustInformations
@model CustInfoExtract
@Html.HiddenFor(x => x.flag, new { @id = "flag" })
@Html.HiddenFor(x => x.StaffId)
<table style=" width:730px">
<tr>
<th>Country</th>
<th>Board</th>
<th>Level</th>
<th>PassedYear</th>
<th>Division</th>
</tr>
<tr>
@Html.EditorFor(x => x.education)
</tr>
<tr>
<td><input type="submit" value="Add Another" id="addedu"/> </td>
</tr>
</table>
我有如下编辑器模板
@using staffInfoDetails.Models
@model staffInfo.education
@Html.HiddenFor(x=>x.staffId)
<tr>
<td >@Html.DropDownListFor(x => x.country, Model.countryList, "--select--", new { @id="country"})</td>
<td>@Html.TextBoxFor(x => x.board, new { @id="board"})</td>
<td>@Html.TextBoxFor(x => x.level, new { @id="level"})</td>
<td>@Html.TextBoxFor(x => x.passedYr, new { @id="passedYr"})</td>
<td>@Html.DropDownListFor(x => x.passedDiv, Model.passedDivList, "--select--", new { @id="division"})</td>
</tr>
我正在尝试将模型从控制器传递到视图,然后从视图传递回控制器。当我将模型传递给视图时,教育列表通过了,但是,当我尝试将模型从视图传递到控制器时,除了教育列表之外的所有其他内容都通过了。我怎么解决这个问题 ?