I am working on MVC 5,
How can I bind a category and sub-category to be shown in the same bootstrap multiselect dropdown ?
Here is the table structure and table name is 'productcategory'.
View,
- <pre><script src="~/Scripts/bootstrap-multiselect.js"></script>
- <link href="~/css/bootstrap-multiselect.css" rel="stylesheet" />
- <script type="text/javascript">
- $(function () {
- $('[id*=DDLProductCate]').multiselect({
- includeSelectAllOption: true, buttonWidth: '213%'
- });
- });
- </script>
- @Html.DropDownListFor(model => model.ShowAdConfigIDs, ViewData["Products"] as List<SelectListItem>, new { @id = "DDLProductCate", @class = "form-control", @multiple = "multiple" })
How can I do this, inside the same DropDownList's ViewData["Products"] using C# LINQ query ?