title: Boolean values not being passed correctly from javascript function to action in ASP.NET MVC Controller
body: <p>I am trying to pass some boolean values from a javascript function to a ASP.NET MVC controller action, but boolean values are not being passed correctly, for example, $('#optChk_5').prop('checked') and $('#optChk_6').prop('checked') are returning false and the rest true. However, when I receive these values in the MVC controller action, all values are true. Why boolean values are not passed correctly from javascript function to action in MVC controller?</p>
  
  <p><strong>Javascript code</strong>:</p>
  
  <pre><code>   function onCheckboxesUpdate() {
          var b01= new Boolean( $('#optChk_4').prop('checked') );
          var b02= new Boolean( $('#optChk_5').prop('checked') );
          var b03= new Boolean( $('#optChk_6').prop('checked') );
          var b04= new Boolean( $('#optChk_7').prop('checked') );
  
          $.ajax({
              url: '@Url.Action("UpdateCheckBoxes", "MyController", new { @area = "MyArea" })',
              type: "POST",
              data: {
                  'Id': @Model.Id,
                  'b01': Boolean(b01),
                  'b02': Boolean(b02),
                  'b03': Boolean(b03),
                  'b04': Boolean(b04)
              },
              dataType: "html",
              async: false,
              success: function (actionResponse) {
              }
          });
      }
  </code></pre>
  
  <p><strong>Action in MVC Controller</strong>:</p>
  
  <pre><code>    public ActionResult UpdateCheckBoxes(int Id,
                                           bool b01,
                                           bool b02,
                                           bool b03,
                                           bool b04)
      {
           // Do something
      }
  </code></pre>