title: bind attribute include and exclude property with complex type nested objects
body: <p>Ok, this is weird. I cannot use <code>BindAttribute</code>'s <code>Include</code> and <code>Exclude</code> properties with complex type nested objects on ASP.NET MVC.</p>
  
  <p>Here is what I did:</p>
  
  <p><strong>Model:</strong></p>
  
  <pre><code>public class FooViewModel {
  
      public Enquiry Enquiry { get; set; }
  }
  
  public class Enquiry {
  
      public int EnquiryId { get; set; }
      public string Latitude { get; set; }
  }
  </code></pre>
  
  <p><strong>HTTP POST action:</strong></p>
  
  <pre><code>[ActionName("Foo"), HttpPost]
  public ActionResult Foo_post(
      [Bind(Include = "Enquiry.EnquiryId")]
      FooViewModel foo) {
  
      return View(foo);
  }
  </code></pre>
  
  <p><strong>View:</strong></p>
  
  <pre><code>@using (Html.BeginForm()) {
  
      @Html.TextBoxFor(m =&gt; m.Enquiry.EnquiryId)
      @Html.TextBoxFor(m =&gt; m.Enquiry.Latitude)
  
      &lt;input type="submit" value="push" /&gt;
  }
  </code></pre>
  
  <p>Does not work at all. Can I only make this work if I define the <code>BindAttribute</code> for <code>Enquiry</code> class as it is stated here: </p>
  
  <p><a href="https://stackoverflow.com/questions/6739012/how-do-i-use-the-bindinclude-attribute-on-complex-nested-objects">How do I use the [Bind(Include=&quot;&quot;)] attribute on complex nested objects?</a></p>