MVC4, 在部分视图下拉列表中不会下拉。我做错了什么? 谢谢
MyView.cshtml
@Html.RenderPartial("MyPartialView1.cshtml", model);
MyPartialView1.cshtml
@model List<MyClass1>
@{
SelectList list1 = MyHelper.GetList1();
MultiSelectList mltpList= new MultiSelectList(lst1, "Value", "Text");
}
............
<div>
<label for="dd1">My Dropdown:</label>
@Html.DropDownList("dd1", mltpList, null, new { multiple = "multiple", id = "dd1" })
</div>
答案 0 :(得分:1)
尝试使用Html.ListBox
代替。像这样:
@Html.ListBox("dd1", mltpList, new { id = "dd1" })