title: mvc harvest chosen multiselect dropdownlist
body: <p>I followed Rick Anderson's example but I can't get it to work. I have the original multi select box but not the harvest chosen multiselect.</p>
  
  <p>View:</p>
  
  <pre><code>@Html.ListBox("Clearances", ViewBag.Clearanceslist as MultiSelectList, new { htmlAttributes = new { @class = "form-control chosen-select", style="width:350px;" } }) 
  </code></pre>
  
  <p>under the view is my javascript:</p>
  
  <pre><code>@section Scripts {
      @Scripts.Render("~/bundles/jqueryval")
  &lt;script type="text/javascript"&gt;
      $('.datepicker').datepicker();
      $(".chosen-select").chosen();
  &lt;/script&gt;
  }
  </code></pre>
  
  <p>This is the scripts I included in the BundleConfig.cs:</p>
  
  <pre><code>public static void RegisterBundles(BundleCollection bundles)
  {
      bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                  "~/Scripts/jquery-{version}.js",
                  "~/Scripts/chosen.jquery.js"
                  ));
  
      bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                  "~/Scripts/jquery.validate*"));
  
      // Use the development version of Modernizr to develop with and learn from. Then, when you're
      // ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
      bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                  "~/Scripts/modernizr-*"));
  
      bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
                "~/Scripts/bootstrap.js",                      
                "~/Scripts/bootstrap-datepicker.js",
                "~/Scripts/respond.js"));
  
      bundles.Add(new StyleBundle("~/Content/css").Include(
                "~/Content/bootstrap.css",
                "~/Content/datepicker.css",
                "~/Content/chosen.css",
                "~/Content/site.css"));
  }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>private MultiSelectList GetClearances(string[] selectedValues)
  {
      return new MultiSelectList(db.Clearances.Where(c =&gt; c.Active == true), "ClearanceID", "ClearanceName", selectedValues);
  }
  
  // GET: CardKeys/Create
  public ActionResult Create()
  {
      ViewBag.Clearanceslist = GetClearances(null);
      return View();
  }
  </code></pre>
  
  <p>What else do I miss?</p>