我的DropDownList与public List<SelectListItem> CountryList { get; set; }
模型的属性绑定为@Html.DropDownListFor(m => m.CountryCode, Model.CountryList, "-- Select --")
。 CountryCode
是持有国家代码的short
财产。我如何能实现从有界的DropDownList获取选定项目的值和文本
1显示在DropDownList的国家代码和名称为"CountryCode - CountryName"
2-接收代码和选定的国家的名称为界传递给操作模型。换句话说,国家代码的类型是SelectListItem
而不是short
PS。无脚本
我想自定义模型结合将是有益的 – bjan 2012-04-06 17:19:46