1
幫助器方法ListBoxFor()是否支持選項組?Asp.Net Mvc:ListBoxFor()支持OptionGroups?
如:http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_optgroup
幫助器方法ListBoxFor()是否支持選項組?Asp.Net Mvc:ListBoxFor()支持OptionGroups?
如:http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_optgroup
的ListBoxFor()
HtmlHelper
擴展方法不支持選項組。但是,您可以使用添加選項組支持的自定義擴展方法來擴展HtmlHelper
。
看看下面的文章:
ASP.NET MVC – Extending the DropDownList to show the items grouped by a category。
+1 - 您的答案值得接受。您不僅正確回答了問題,還提供瞭解決方案的鏈接。 –