title: How do i strongly bind an Ienumerable class to a view in MVC asp.net?
body: <p>Please i have a model class below</p>
  
  <pre><code> public class EditJob
   {
          public JobPost JobPost { get; set; }
          public IEnumerable&lt;JobRequirement&gt; JobRequirement { get; set; }
          public IEnumerable&lt;JobResponsibility&gt; JobResponsibility { get; set; }
    }
  </code></pre>
  
  <p>I strongly bind the class to a view and want to use it for editing in controller. I have a controller which receives model like below.</p>
  
  <pre><code>[HttpPost]
  public ViewResult SaveJob(EditJob model)
  {
  
  }
  </code></pre>
  
  <p>I Dynamically bind my Ienumerable to texboxes in my view like below.</p>
  
  <pre><code>@for (int i = 0; i &lt; Model.JobResponsibility.Count();i++ )
   {
  
    JobWebsite.Domain.Enitities.JobResponsibility rs = Model.JobResponsibility.ElementAt(i);
    &lt;label class="control-label"&gt;Responsibility :&lt;/label&gt;
     Html.Hidden("Responsibility[" + i + "]", rs);
     @Html.TextBoxFor(x =&gt; rs, new { @class = "form-control" }) &lt;br /&gt;
  
   }
  </code></pre>
  
  <p>On my button click, I realized the two IEnumerable methods from my model are not binding . The JobPosts in the model is not empty, yet my Ienumerable properties not always empty . I added a hidden field holding my values but i am having problem passing them to the controller. Please how do i achieve this ?</p>