title: MVC Property of object in model is null on post
body: <p>I know there are tons of posts similar to this, but I cannot seem to find the answer after much investigation.  On post back CompanySetting.NewSetting.SettingType and CompanySetting.NewSetting.SettingValue are null, despite putting text into the TextBoxFor fields and clicking submit.
  Why is this?</p>
  
  <p>Here is the view:</p>
  
  <pre><code>@model Project.Models.CompanySettingView
  @using (Html.BeginForm())
                  {
          @Html.AntiForgeryToken()
          @Html.ValidationSummary(true)
          &lt;form&gt;
              &lt;div class="form-group"&gt;
               &lt;label&gt;Setting Type&lt;/label&gt;
               @Html.TextBoxFor(m =&gt; m.NewSetting.SettingType, new { @class = "form-control", @id = "SettingType" })
  
              &lt;br /&gt;
  
               &lt;label&gt;Setting Value&lt;/label&gt;
               @Html.TextBoxFor(m =&gt; m.NewSetting.SettingValue, new { @class = "form-control", @id = "SettingValue" })
  
              &lt;br /&gt;
            &lt;/div&gt;
              &lt;div style="float: right;"&gt;
              &lt;button type="button" style="width:100px;" onclick="ClearFields()" class="btn btn-default"&gt;Clear&lt;/button&gt;
              &lt;button type="submit" style="width:100px;" class="btn btn-primary"&gt;Submit&lt;/button&gt;
             &lt;/div&gt;
           &lt;/form&gt;
                  }
  </code></pre>
  
  <p>Receiving Controller:</p>
  
  <pre><code> [HttpPost]
  public ActionResult AddCompanySetting(CompanySettingView model)
  {
  ...
  }
  </code></pre>
  
  <p>CompanySettingView Class:</p>
  
  <pre><code>public class CompanySettingView
  {
      public List&lt;CompanySetting&gt; Settings = new List&lt;CompanySetting&gt;();
      public CompanySetting NewSetting = new CompanySetting();
  }
  </code></pre>
  
  <p>CompanySetting Class:</p>
  
  <pre><code> public class CompanySetting
   {
       public int CompanySettingId { get; set; }
       public int CompanyId { get; set; }
       public string SettingType { get; set; }
       public string SettingValue { get; set; }
   }
  </code></pre>