MVC 新手又来了!
我的控制器中有两个列表。
IList<Cars> allCars = _repository.GetAll<Cars>();
IList<Bikes> allBikes = _repository.GetAll<Bikes>();
Cars { Id, Name }
Bikes { Id, Name }
所以,我有这个类列表,我想显示一个选择下拉列表,其中包含自行车和汽车的 optgroup,如下所示:http: //jsfiddle.net/xNEm9/
谢谢!