title: Can not pass the model back to controller from view in ASP.NET MVC. Model is null when received
body: <p>I have two model classes</p>
  
  <pre><code>public class Item
  {
      public string Name;
      public SubItem SubObject { get; set; }
  }
  
  public class SubItem
  {
      public int Age { get; set; }
      public string Work { get; set; }
  }
  </code></pre>
  
  <p>From my code I have something similar to this</p>
  
  <pre><code>public IActionResult ViewAndSend()
  {
          Item item = new Item
          {
              Name = "MyName",
              SubObject = new SubItem
              {
                  Age = 29,
                  Work = "Microsoft and google"
              },
          };
  
      return View(item);
  }
  </code></pre>
  
  <p>and my <code>ViewAndSend.cshtml</code> looks like this</p>
  
  <pre><code>@model TestNavigation.Models.Item
  
  &lt;h2&gt;ViewAndSend example&lt;/h2&gt;
  &lt;p&gt;@(String.Format("{0} {1}", "Name", Model.Name))&lt;/p&gt;
  &lt;p&gt;@(String.Format("{0} {1}", "Age", Model.SubObject.Age))&lt;/p&gt;
  &lt;p&gt;@(String.Format("{0} {1}", "Work", Model.SubObject.Work))&lt;/p&gt;
  
  @using (Html.BeginForm("SendSubItem", "Home", FormMethod.Post))
  {
      @Html.HiddenFor(m =&gt; m.SubObject.Age)
      @Html.HiddenFor(m =&gt; m.SubObject.Work)
  
      &lt;input type="submit" value="Next" /&gt;
  }
  </code></pre>
  
  <p>My <code>SendSubItem</code> method looks like this</p>
  
  <pre><code>[HttpPost]
  public IActionResult SendSubItem(SubItem subItem)
  {
          int age = subItem.Age; //age is 0
          var work = subItem.Work; // work is null
  
          return View();
  }
  </code></pre>
  
  <p>The <code>ViewAndSend.cshtml</code> prints the correct values. However the <code>SendSubItem</code> method gets an object with 0 as <code>Age</code> and null for <code>Work</code>. </p>
  
  <p>Can anyone explain what I am doing wrong?</p>