我有一个看起来像这样的 Razor 视图:
@model Namespace.Namespace.SupplierInvoiceMatchingVm
@using(Html.BeginForm("MatchLines", "PaymentTransaction"))
{
    <table class="dataTable" style="width: 95%; margin: 0px auto;">
    <tr>
        <th></th>
        <th>PO Line</th> 
        <th>Description</th> 
    </tr>
    @for (var i = 0; i < Model.Lines.Count; i++)
    {
        <tr>
            <td>@Html.CheckBoxFor(x => x.Lines[i].Selected)</td>
            <td>@Html.DisplayFor(x =>x.Lines[i].LineRef) @Html.HiddenFor(x => x.Lines[i].LineRef)</td>
            <td>@Html.DisplayFor(x =>x.Lines[i].Description) @Html.HiddenFor(x => x.Lines[i].Description)</td>
        </tr>
    }
    </table>
    <input type="submit" value="Submit"/>
}
对象Lines列表在哪里,方法签名看起来像SupplierInvoiceMatchingDtoMatchLines
public ActionResult MatchLines(IEnumerable<SupplierInvoiceMatchingDto> list)
当我点击此视图上的提交按钮时,列表以null.
但是,如果我将 更改Model为List<SupplierInvoiceMatchingDto>,并将所有表行更改为x => x[i].Whatever,它会发布所有信息。
我的问题是:我如何让它将列表发布到控制器,同时保留模型,SupplierInvoiceMatchingVm因为我需要在这个视图中从模型中获取一些其他东西(为了简洁起见,我已经取出了)。
注意:我删除了一些用户输入字段,它不仅仅是发布与给出的相同数据。