【发布时间】:2011-12-07 14:14:01
【问题描述】:
您好,我正在尝试提交父母和孩子,我可以提交父母罚款但不能提交孩子,有什么办法吗?
这是我的代码。
@model IECWeb.Models.CurrencyDay
using (Html.BeginForm()) {
@Html.ValidationSummary(true)
<fieldset>
<legend>CurrencyDay</legend>
<div class="editor-label">
@Html.LabelFor(model => model.CurrencyDate)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.CurrencyDate)
@Html.ValidationMessageFor(model => model.CurrencyDate)
</div>
<p />
<table>
<tr>
<th>Currency</th>
<th>Rate</th>
</tr>
@foreach (var item in Model.Currency) {
<tr>
<td>
<div class="editor-field">
@Html.EditorFor(model => item.Name)
@Html.ValidationMessageFor(model => item.Name)
</div>
</td>
<td>
<div class="editor-field">
@Html.EditorFor(model => item.Rate)
@Html.ValidationMessageFor(model => item.Rate)
</div>
</td>
</tr>
}
</table>
<p>
<input type="submit" value="Create" />
</p>
</fieldset>
当我提交时,我得到 CurrencyDay 对象但不是货币列表
谢谢 寿司。
【问题讨论】:
标签: asp.net-mvc-3 razor submit parent-child