【问题标题】:drop down list for using mvc 5使用 mvc 5 的下拉列表
【发布时间】:2014-11-20 10:21:28
【问题描述】:

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

但是我看不懂视图页面中的“--select--”,如果是select语句的意思,那么在controller中已经提到了,是不是还要再提一下?

【问题讨论】:

  • 它作为默认项目显示在下拉列表中。

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


【解决方案1】:

它的选项标签。当页面被渲染并且没有选择任何选项时显示的标签。

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

见:enter link description here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-10
    • 2014-05-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多