title: HiddenFor on Partial View form contains no elements
body: <p>I have a partial view which contains a form. I am trying to pass the lists in a hidden input element, so that when there is an invalid model state it can post-back properly. The issue is that the hidden input entities contains no data (it is not null it is just empty).</p>
  
  <p>My parent view contains a view model containing two view models (1 for the child 1 for the parent)</p>
  
  <pre><code>public class UsersModel
  {
      public CreateUserModel CreateModel { get; set; }
      public IEnumerable&lt;UserTableModel&gt; UserData { get; set; }
  }
  </code></pre>
  
  <p>The controller action (GET) for my parent view sets both the CreateModel and UserData and stores the <code>UserData</code> into a <code>TempData</code> variable, so that it can be passed back to the parent view in the case of an invalid model state.</p>
  
  <p>My child view / partial view contains the following</p>
  
  <pre><code>@model APGame.Client.ViewModels.CreateUserModel
  
  @using (Html.BeginForm("Users", "Admin", FormMethod.Post, new {role = "form", autocomplete = "off"}))
  {
  
      @Html.HiddenFor(m =&gt; m.Roles)
      @Html.HiddenFor(m =&gt; m.Institutions)
      @Html.HiddenFor(m =&gt; m.InvestigatorGroups)
      @Html.HiddenFor(m =&gt; m.Participation)
      @Html.HiddenFor(m =&gt; m.FamilyGroups)
  </code></pre>
  
  <p>And in the case of an invalid model state, my POST controller action does the following</p>
  
  <pre><code>var userModel = new UsersModel()
  {
      UserData = TempData["UserData"] as IEnumerable&lt;UserTableModel&gt;,
      CreateModel = model
  };
  
  return View("Users", userModel);
  </code></pre>