I am in need of a dropdown list with checkboxes in asp.net mvc. The issue is that my view already has a layout page with existing script files, which seem to be causing a disturbance in the original layout.
I have tried various solutions such as rearranging the script files, commenting out individual scripts to see their impact, etc.
Here is my dropdown list:
@Html.DropDownListFor(m => m.CompanyId,(IEnumerable<SelectListItem>)ViewBag.cmpName, new { @id = "drpdown", @class = "listbox" ,@multiselect="multiselect"})
Included files:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css"
rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/js/bootstrap.min.js"></script>
<link href="http://cdn.rawgit.com/davidstutz/bootstrap-multiselect/master/dist/css/bootstrap-multiselect.css" rel="stylesheet" type="text/css" />
<script src="http://cdn.rawgit.com/davidstutz/bootstrap-multiselect/master/dist/js/bootstrap-multiselect.js" type="text/javascript"></script>
<script src="http://code.jquery.com/jquery-1.5.js"></script>
And here is the javascript:
<script type="text/javascript">
$(function () {
$('#drpdown').multiselect({
includeSelectAllOption: true
});
});
</script>
Despite my efforts, I expected the dropdown with checkboxes but unfortunately, I did not get any checkboxes: 1
I am aiming for something like this: 2