Hi friends,
I am using mvc5. I built one application for multiselect dropdownlist. I download and add js & css file for multiselect but it is not working
Application is running good.. but multiselect dropdown is not come..pls help me to solve this issue:
Controller:
<pre lang="cs">public ActionResult Index()
{
var emp = new Class1();
emp.emlist.Add(new SelectListItem() { Text = "Select Employee", Value = "0" });
var employeelist = t.customers.ToList();
foreach(var v in employeelist)
{
emp.emlist.Add(new SelectListItem() { Text = v.name, Value = v.ID.ToString() });
}
return View(emp);
}</pre>
View:
@model multiselect.Models.Class1
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<script src="~/Content/jquery-multiselect.js"></script>
<link href="~/Content/jquery-multiselect.css" rel="stylesheet" />
@Html.ListBoxFor(model => model.eid, new System.Web.Mvc.MultiSelectList(Model.emlist, "Value", "Text", Model.emlist), new { @class = "emplist" })
<pre lang="xml"><script type="text/javascript">
$(function () {
$(".emplist").multiselect({ multiple: true, header: "Select status" });
});
</script></pre>