title: Bootstrap Multiselect Get Selected values on HttpPost
body: <p>I'm using this <a href="http://davidstutz.github.io/bootstrap-multiselect/#getting-started" rel="noreferrer">Bootstrap Multiselect</a> and my problem is that I cant get the selected values on HttpPost on ASP.Net MVC.</p>
  
  <p>Problems Encountered:</p>
  
  <ul>
  <li><p>after clicking save, Only the first selected value is the present on
  the model. (<strong>SOLVED</strong>)</p></li>
  <li><p>after clicking save, Only the first selected value is the present on
  the dropdownlist.</p></li>
  </ul>
  
  <p>Sample.chtml:</p>
  
  <pre><code>@model SampleProject.Models.SampleViewModel
  
  @using (Html.BeginForm())
  {
      @Html.DropDownListFor(model =&gt; model.Selected, new SelectList(Model.List, "value", "text"), new { @class = "multiselect form-control", multiple = "multiple" })
      &lt;input type="submit" value="Save" /&gt;
  }
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code>public class SampleViewModel
  {
      public string[] Selected { get; set; }
      public SelectList List { get; set; }
  }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public class DashboardController : Controller
  {
      public ActionResult Sample()
      {
          SampleViewModel model = new SampleViewModel();
          model.List = new SelectList(new List&lt;string&gt;() { "1", "2", "3" });
  
          return View(model);
      }
  
      [HttpPost]
      public ActionResult Sample(SampleViewModel model)
      {
          model.List = new SelectList(new List&lt;string&gt;() { "1", "2", "3" });
  
          return View(model);
      }
  }
  </code></pre>
  
  <p>Selection:</p>
  
  <p><img src="https://i.stack.imgur.com/mPFWL.png" alt="Selection"></p>
  
  <p><strong>I cant get the selected values correctly on HttpPost</strong></p>
  
  <p>Code Behind/HttpPost: (Wrong)
  <img src="https://i.stack.imgur.com/pv5fM.png" alt="HttpPost"></p>
  
  <p>After HttpPost: (Correct)</p>
  
  <p><img src="https://i.stack.imgur.com/eVzDX.png" alt="After"></p>