title: How to pass a List from the View to the Controller in ASP.NET?
body: <p>I have a Product ViewModel where I have a list of objects</p>
  
  <pre><code>public List&lt;ValueStream&gt; ListValueStream { get; set; } //ProductViewModel.cs
  </code></pre>
  
  <p>In my View, I decided to use a ListBoxFor in order to select multiples entries.</p>
  
  <pre><code>using (var context = new TempoV2.DAL.TempoV2Context())
  {
      @Html.ListBoxFor(model =&gt; model.ListValueStream, new SelectList(context.ValueStream.ToList(), "Id", "Name"))
  }
  </code></pre>
  
  <p>It displays correctly, however when I select multiple entries, it says that </p>
  
  <blockquote>
    <p>The value '4,5,6' is invalid</p>
  </blockquote>
  
  <p>I look up in the database, and 4, 5 and 6 match the ValueStream that I selected. </p>
  
  <p>If I understand correctly, it does not match the model from the ViewModel.</p>
  
  <p>So how can I manage to pass a List from the view to the controller?</p>