我想使用多个选择
Chosen.
我有技能模型,
Chosen.
我有技能模型,
public class Skill { public int Id { get; set; } public string Name { get; set; } }
这适用于我的应用程序:
<select data-placeholder="Choose a Country..." class="chzn-select" multiple > <option value=""></option> <option value="United States">United States</option> <option value="Albania">Albania</option> <option value="Algeria">Algeria</option> </select>
我想用我的数据替换国家/地区数据.在控制器我写:
var list = MyService.LoadAllSkills(); ViewBag.Skills = new MultiSelectList(list,"Id","Name");
看来:
@Html.ListBox("Name",ViewBag.Skills as MultiSelectList,new { @class = "chzn-select" } )
查看@ Html.ListBox()和@ Html.DropDownList()的结果不像< select>
我得到的结果:
但是,我想得到结果
如何更改所选样品?