title: why is checkbox always true
body: <p>I am using  <code>@Html.CheckBoxFor(x =&gt; x.Luxury)</code></p>
  
  <p>which generates the following HTML</p>
  
  <pre><code>&lt;input id="Luxury" type="checkbox" value="true" name="Luxury" data-val-required="The Luxury field is required." data-val="true"&gt;
  &lt;input type="hidden" value="true" name="Luxury"&gt;
  </code></pre>
  
  <p>So no matter what I set the check box to the controllers action is getting the value as TRUE, even when not checked.</p>
  
  <p>How do I get MVC not to make a checkbox return true.
  When I debug on the first Brace even before I call any code I can see Banner.Luxury is always = true</p>
  
  <p>My Class</p>
  
  <pre><code>   public class Banner
     {
           public int Id { get; set; }
           public bool Luxury { get; set; }
     }
  
  
  
  [HttpPost]
  public ActionResult Save(Banner banner)
  
         ....
  }
  </code></pre>
  
  <p>Looking at this question <a href="https://stackoverflow.com/questions/1127357/why-does-asp-net-mvc-html-checkbox-output-two-inputs-with-the-same-name">Why does ASP.NET MVC Html.CheckBox output two INPUTs with the same name?</a> does not help as when I run</p>
  
  <pre><code>Convert.ToBoolean(Request.Form.GetValues("Luxury"));
  </code></pre>
  
  <p>There is only "true"  not "true;false";</p>
  
  <p><strong>This workaround works but its a bad HACK</strong></p>
  
  <pre><code> @{      if (Model.Luxury)
           {
                   &lt;input type="checkbox" name="Luxury" value="1" checked="checked" /&gt;
           }
           else
           {
                    &lt;input type="checkbox" name="Luxury" value="1" /&gt;
           }
     }
  </code></pre>
  
  <p>code</p>
  
  <pre><code> banner.Luxury = !(Request.Form.GetValues("Luxury") == null);
  </code></pre>