title: MVC Razor binding to a list within a list
body: <p>I've got a list of objects with a list of objects inside and i'm trying to bind to them in a form but the sublist is coming back as null when I submit. I was hoping someone might be able to spot where i'm going wrong/ or if this is even possible.</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>@for (var i = 0; i &lt; Model.AlgorithmOutput.Activities.Count; i++)
  {
  &lt;div id="@("panel" + i)" class="panel panel-danger"&gt;
      &lt;div class="panel-heading" role="tab" id="headingOne"&gt;
          &lt;h4 class="panel-title"&gt;
              &lt;a data-toggle="collapse" data-parent="#accordion" href="#@i" aria-expanded="true" aria-controls="collapseOne"&gt;
                  @Html.EditorFor(model =&gt; model.AlgorithmOutput.Activities[i].ActNo)
                  @Html.EditorFor(model =&gt; model.AlgorithmOutput.Activities[i].Method)
                  @Html.EditorFor(model =&gt; model.AlgorithmOutput.Activities[i].Area)
                  @Html.EditorFor(model =&gt; model.AlgorithmOutput.Activities[i].Exposure)
              &lt;/a&gt;
          &lt;/h4&gt;
      &lt;/div&gt;
      &lt;div id="@i" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne"&gt;
          &lt;div class="panel-body"&gt;
              &lt;ul id="@("actSyms" + i)" class="Symbols"&gt;
                  @for (var x = 0; x &lt; Model.AlgorithmOutput.Activities[i].ActSyms.Count; x++)
                  {
                      &lt;li class="actSymItem"&gt;
                          &lt;a onclick=" DeleteActSym(this); return false; " href="#"&gt;&lt;span class="glyphicon glyphicon-trash"&gt;&lt;/span&gt;&lt;/a&gt;
                          @Html.HiddenFor(model =&gt; model.AlgorithmOutput.Activities[i].ActSyms[x].CommCode)
                          @Html.Image("../Content/Images/Symbols/" + Model.AlgorithmOutput.Activities[i].ActSyms[x].SymbCode + ".jpg", Model.AlgorithmOutput.Activities[i].ActSyms[x].SymbCode, "dd")
                          @Html.EditorFor(model =&gt; model.AlgorithmOutput.Activities[i].ActSyms[x].SymbCode)
                          @Html.EditorFor(model =&gt; model.AlgorithmOutput.Activities[i].ActSyms[x].Comment, new { htmlAttributes = new { rows = 3, cols = 12, @class = "form-control" } })
                      &lt;/li&gt;
                  }
                  &lt;a href="#" id="@i" onclick=" NewActSym(this); return false; "&gt;Add&lt;/a&gt;
              &lt;/ul&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  }
  </code></pre>