0
我在网上搜索,我想我的代码应该是正确的,但是当你提交的模型领域始终是0 型号:MVC html.dropdownlistfor没有更新模型场
public class ProductsModel
{
public List<Products> ProductCommission;
public List<ProductGroupType> ProductGroupType;
public CommissionType CommissionType;
public int FilterProductGroupTypeId;
public string Status;
}
查看:
@Html.DropDownListFor(m => Model.FilterProductGroupTypeId, new SelectList(Model.ProductGroupType, "ID", "Description"), "All")
@Html.HiddenFor(m => Model.FilterProductGroupTypeId);
@* @Html.ActionLink("Filter", "FilterProductTypes", "Products", new { filterid = Model.FilterProductGroupTypeId });*@
<a href="@Url.Action("FilterProductTypes", "Products", new { filterid = Model.FilterProductGroupTypeId})">Filter</a>
控制器:
public ViewResult FilterProductTypes(int filterid)
{
...
}
的下拉列表显示正常,但不管是什么I S选择它将0发送给控制器。