问题描述
他是我从 Nugget 包“bootstrap.Chosen”下载的。我也在使用“@Html.DropDownListFor”。我也为 jQuery 设置了 id。一切看起来都正确,但它无法在我的下拉列表中找到搜索栏。我的代码如下。
<div class="form-group">
@Html.LabelFor(m => m.Messageto,htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.DropDownListFor(m => m.Messageto,(SelectList)ViewBag.Employeelist,new { id =
"Dropdown" }) //I setup Id for using jQuery.
</div>
</div>
@section Scripts{
<script>
$(function () {
$("#Dropdown").chosen();
});
</script>
}
我还设置了布局页面
@Styles.Render("~/Content/css")
@RenderSection("scripts",required: false)
<script src="~/Scripts/chosen.jquery.min.js"></script>
<link href="~/Content/bootstrap-chosen.css" rel="stylesheet" />
我不知道为什么我的下拉列表中不能使用搜索栏。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)