下拉列表使用mvc 5

时间:2014-11-20 10:21:28

标签: asp.net-mvc asp.net-mvc-5 html.dropdownlistfor

我正在寻找一个dropdownlistforcexample,发现这就是我需要的There is no ViewData item of type 'IEnumerable<SelectListItem>' that has the key 'CategoryID'

但是我无法理解视图页面中的“ - 选择 - ”,如果它意味着选择语句,那么它已经在控制器中提到了,我是否必须再次提及它?

1 个答案:

答案 0 :(得分:0)

它的选项标签。页面渲染时未显示选项时显示的标签。

  

optionLabelType:System.String   默认空项的文本。此参数可以为null。

请参阅:enter link description here