开发者

how to make optgroup in asp.mvc?

开发者 https://www.devze.com 2023-03-28 05:37 出处:网络
MVC newbie here again! I have two lists in my controller. IList<Cars> allCars = _repository.GetAll<Cars>();

MVC newbie here again!

I have two lists in my controller.

IList<Cars> allCars = _repository.GetAll<Cars>();
IList<Bikes> allBikes = _repository.GetAll<Bikes>();

Cars { Id, Name }
Bikes { Id, Name }

So, I have this list of class and I want to display a select dropdown list with an optgro开发者_高级运维up for bikes and cars, something like this: http://jsfiddle.net/xNEm9/

thanks!


I don't think you can without additional code but I think somebody worked on it before: Support for optgroup in dropdownlist .NET MVC?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号