ASP.Net MVC 3:OPTGROUP支持Html.DropDownListFor [英] ASP.Net MVC 3: optgroup support in Html.DropDownListFor

查看:142
本文介绍了ASP.Net MVC 3:OPTGROUP支持Html.DropDownListFor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能让我的DropDownListFor支持OPTGROUP?
反正有做呢?
注意,这是DropDownListFor,意味着它支持DataAnnotation客户端验证


解决方案

  

我怎样才能让我的DropDownListFor支持OPTGROUP?


有没有内置支持的框架,这种下拉列表。您必须编写自己的定制助手或手动生成HTML(我倾向于第一种选择)。

How can i make my DropDownListFor support optgroup? Is there anyway to do it? Notice that this is DropDownListFor, means that it support DataAnnotation client validation

解决方案

How can i make my DropDownListFor support optgroup?

There is no built-in support in the framework for this kind of drop down lists. You will have to write your own custom helper or generate the HTML manually (I would tend towards the first option).

这篇关于ASP.Net MVC 3:OPTGROUP支持Html.DropDownListFor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆