I'm using ASP.net MVC with bootstrap. I have two dropdown lists that I use bootstrap-select on to match the theme. The problem is that if I click the dropdown list, it doesn't show its content. However, if I press the down (or up) key when it's focused it will display the contents of the dropdown list.
Razor:
<div class="form-group">
@Html.LabelFor(m => m.Profession, new { @class = "col-md-2 control-label" })
<div class="col-md-10">
@Html.DropDownListFor(m => m.Profession, new SelectList(Enum.GetValues(typeof(Profession))),
"Select Profession", new { @class = "selectpicker" })
</div>
</div>
Javascript:
<script type="text/javascript">
$(document).ready(function () {
$('select').selectpicker();
});
</script>`
Any ideas? I've been stuck on this too long :-)