I need a dropdownlist with checkboxes in asp.net mvc.
Now my view already has a Layout page which already contains few script files.
Now according to me the script files that im using are somewhere disturbing the original layout or vice versa
I have already tried possible solutions to change the script files ,arrange them in some other way.commenting single ones and see what changes that they make,etc
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 javascript :
<script type="text/javascript">
$(function () {
$('#drpdown').multiselect({
includeSelectAllOption: true
});
});
</script>
i expected dropdown with checkboxes but i didnt get any checkboxes : 1
I want something like this :
2
2
Answers
You can see the example which I coded, Your code didn’t work due to not properly imported the plugins,
I hope this example will help to you.
Just remove this
this override the working jquery plugin