title: Issue with @Html.CheckBoxFor always posting false via $.Ajax Post Method in ASP.NET-MVC5 App
body: <p>I trying to post data via jQuery Ajax function in JSON format which is working fine, howerver I have bool value and using html.checkBoxFor which is always posting false even I check it. I have update code in javaScript and force change the hidden input value accordingly if its check or not and I can see in debuging that is posting true when clicked but still receiving false on controller side. In attached screen shots you can see the post correct value but not in-correct value on controller</p>
  
  <p><a href="https://i.stack.imgur.com/odniw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/odniw.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/UXPSd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UXPSd.png" alt="enter image description here"></a></p>
  
  <h2>Model Class Attribute</h2>
  
  <pre><code>  [Display(Name = "Secure Entire Property")]
    [Required(ErrorMessage = "Require Information on If You Want to Secure Entire Property")]
    public bool SecureEntireProperty { get; set; }
  </code></pre>
  
  <h2>Razor code</h2>
  
  <pre><code>&lt;div class="form-group"&gt;
     @Html.LabelFor(model =&gt; model._RentingApplicationModel.SecureEntireProperty, htmlAttributes: new { @class = "control-label col-md-2" })
   &lt;div class="col-md-10"&gt;
      &lt;div class="checkbox"&gt;
       @*@Html.EditorFor(model =&gt; model._RentingApplicationModel.SecureEntireProperty)*@
       @Html.CheckBoxFor(model =&gt; model._RentingApplicationModel.SecureEntireProperty, new { @id = "SecureEntirePropertyCheck" })
       @Html.ValidationMessageFor(model =&gt; model._RentingApplicationModel.SecureEntireProperty, "", new { @class = "text-danger" })
         &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <h2>JavaScript</h2>
  
  <pre><code> $("#SecureEntirePropertyCheck").click(function () {
  
      if ($(this).is(':checked'))
      {
          $('[name="_RentingApplicationModel.SecureEntireProperty"]:hidden').val(true);
      }
      else
      {
          $('[name="_RentingApplicationModel.SecureEntireProperty"]:hidden').val(false);
      }
  });
  </code></pre>
  
  <h2>Jquery Ajax Method Where I am Posting</h2>
  
  <pre><code> $.ajax({
          url: formURL,
          type: "POST",
          dataType: "application/json",
          contentType: "application/json; charset=utf-8",
          data: JSON.stringify({ TenentJSONList: AdditionalTenentList, ApplicationModelData: $("#CreateStudentRentingApplicationForm").serializeObject() }),
      }).done(function (data, textStatus, jqXHR) {
          //....my rest of code 
  </code></pre>
  
  <h2>AdditionalTenentList</h2>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
   var AdditionalTenentList = new Array();
  
   $(".additionalTententUWLID").on("change", function () {
  
   var StudentUWLID = $(this).val();
  
   $(this).attr('id', StudentUWLID);
  
   $.ajax({
          url: '@Url.Action("GetStudentRecordByID", "StudentProfile")',
              type: "POST",
              dataType: "JSON",
              data: { _GivenStudentUWLID: StudentUWLID },
              cache: false
          }).done(function (data, textStatus, jqXHR) {
  
              if (data.RecordStatus == "NotAvailable")
              {
                  alert("error");
              }
              else if(data.RecordStatus=="recordFound")
              {
                 // alert(data.Response);
  
                  var paraedData = JSON.parse(data.Response);
  
                  AdditionalTenentList.push(StudentUWLID);
             ....my rest of code
  &lt;/script&gt;
  </code></pre>