title: Hidden field not storing value from partial view into an array of complex object
body: <p>I am unable to get an array of a complex type in the model to store its value IsAssigned between two actions in a controller.</p>
  
  <p>Once the model has been composed, which including the array of complex type (which include IsAssigned), the view engine begins to render the HTML/Razor script. In the view, there is a section of the script that handles the displaying of the controls which manipulates the complex type. It is a "For i" loop that cycles through the array of complex type.</p>
  
  <p>During this loop, there is a razor command HiddenFor for property IsAssigned which is contained inside of the complex type array.</p>
  
  <p>A second step is carried out in the loop that renders a partial view. It is in this view where there are two radio buttons linked to an array position's IsAssigned boolean? property. If the user select yes the property turns to true, and no false.</p>
  
  <p>After the view has been completely rendered and the user has made their selections, the next action method in the controller is activated and the model is passed to it. It is here where I expect the user choices against the IsAssigned property to persist, but no. It does not.</p>
  
  <p>Below is the code for looping and the code for the partial view.</p>
  
  <p>Loop</p>
  
  <pre><code>    @for (int i = 0; i &lt; Model.KitTypeAssignment.Length; i++)
  {
      @Html.HiddenFor(m =&gt; m.KitTypeAssignment[i].IsKitTypeActiveForSubject)
      @Html.HiddenFor(m =&gt; m.KitTypeAssignment[i].KitType.Code)
      @Html.HiddenFor(m =&gt; m.KitTypeAssignment[i].KitType.Description)
      @Html.HiddenFor(m =&gt; m.KitTypeAssignment[i].KitType.KitTypeId)
  
      @Html.HiddenFor(m =&gt; m.KitTypeAssignment[i].IsAssigned, new { @Name = "IsAssigned" + Model.KitTypeAssignment[i].KitType.Code })
  
      @Html.Partial("_KitTypeDispensing", Model.KitTypeAssignment[i])
  }
  </code></pre>
  
  <p>PartialView</p>
  
  <pre><code>    &lt;div class="field inline spacer20"&gt;
  @{
  
      var kitTypeAssign = String.Format("{0}{1}", Model.KitType.Code, "Assign");
      var identityOfAssigned = new { id = @kitTypeAssign, @Name = "IsAssigned" + Model.KitType.Code };
  
      var kitTypeNoAssign = String.Format("{0}{1}", Model.KitType.Code, "NoAssign");
      var identityOfNoAssigned = new { id = @kitTypeNoAssign, @Name = "IsAssigned" + Model.KitType.Code };
  
      var sectionTitle = string.Format("{0} {1}", PromptText.Assign_185B7133DB22230701A857C059360CC2.ToLocalizableString(), Model.KitType.Description);
  
      @Html.Label(sectionTitle, new { @class = "colon" })
      @Html.RadioButtonFor(m =&gt; m.IsAssigned, true, @identityOfAssigned)
      &lt;label for=@kitTypeAssign&gt;@Html.PromptFor(PromptText.Yes_93CBA07454F06A4A960172BBD6E2A435)&lt;/label&gt;
      @Html.RadioButtonFor(m =&gt; m.IsAssigned, false, @identityOfNoAssigned)
      &lt;label for=@kitTypeNoAssign&gt;@Html.PromptFor(PromptText.No_BAFD7322C6E97D25B6299B5D6FE8920B)&lt;/label&gt;
  }
  &lt;/div&gt;
  </code></pre>