title: HTML ListBox name for data binding in ASP.Net mvc
body: <p>I have <strong>ViewModel</strong> as follows:</p>
  
  <pre><code>public class ClientListView
  {
      public List&lt;Client&gt; existingClients { get; set; }
      public List&lt;Client&gt; allClients { get; set; }
  }
  </code></pre>
  
  <p>Definition of <strong>Client</strong> class as follows:</p>
  
  <pre><code>public class Client
  {
      public int ClientId { get; set; }
      public string Name { get; set; }
  
  }
  </code></pre>
  
  <p>In the <strong>.cshtml</strong> </p>
  
  <pre><code> &lt;td&gt;
   &lt;select name="existingClients" id="existingClients" multiple size="20"&gt;
   @foreach (var item in Model.existingClients)
   {
        &lt;option value=@item.ClientId&gt;@item.Name&lt;/option&gt;
   }
   &lt;/select&gt;
   &lt;/td&gt;
  </code></pre>
  
  <p>Manually I am building the HTMLList element.</p>
  
  <p>In the Controller class the Model binding is not working for the listbox. </p>
  
  <pre><code>    [HttpPost]
      public ActionResult ClientList(ClientListView clientListView)
      {
  
          return View();
  
      }
  </code></pre>
  
  <p>It is for sure the names in the html forms and the members names in class(ClientListView) are not matching.</p>
  
  <p>What should be the HTMLList box name in the above case to make sure the Model binding happens and I get the form submitted data in the controller?</p>
  
  <p>I am using the latest ASP.Net MVC. </p>
  
  <p>Thank you</p>