0
我有,我想綁定到選擇列表不張貼選擇選項控制器
public class InvoiceList
{
public string InvoicerReference { get; set; }
public Invoice SelectedInvoice{ get; set; }
public List<Invoice> Invoices { get; set; }
}
這裏當前發票清單模式選擇列表視圖
@using (Html.BeginForm("Invoice", "Billing", FormMethod.Post))
{
@Html.DropDownListFor(m => m.SelectedInvoice, new SelectList(Model.Invoices, "invoiceReference", "InvoiceDisplay"))
<input type="submit" id="btnSelectInvoice" />
}
下拉但是,當我張貼到我的控制器模型爲空
public ActionResult Invoice(InvoiceList invoiceReference)
{
....
return View(invoiceList);
}
任何人都可以看到我在做什麼不正確?