2
這是我的觀點,教育是模型中的列表。將EditorFor的值傳遞給控制器
@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>
我試圖通過從控制器模型查看並從視圖控制器回來。當我通過模型查看時,教育列表已通過,但是,當我試圖將模型從視圖傳遞給控制器時,除了教育列表外,其他所有內容都通過了。我怎麼解決這個問題 ?