title: How can I get Html.CheckBox() as boolean during POST in custom IModelBinder?
body: <p>I am using <code>Html.CheckBox()</code>.  The resulting HTML is:</p>
  
  <pre><code>&lt;input id="IsMultiGraph" name="IsMultiGraph" value="true" type="checkbox"&gt;
  &lt;input name="IsMultiGraph" value="false" type="hidden"&gt;
  </code></pre>
  
  <p>On the server I have an Action which is accepting the form post information and using a custom IModelBinder to bind the form results to one of my models.  Here is a snippet of the code I am running in the IModelBinder:</p>
  
  <pre><code>bool isMultiGraph;
  if (!bool.TryParse(bindingContext.HttpContext.Request["IsMultiGraph"], out isMultiGraph))
      bindingContext.ModelState.AddModelError("IsMultiGraph", "Invalid boolean for \"IsMultiGraph\""); //this should not ever happen unless someone is programatically posting
  result.IsMultiGraph = isMultiGraph;
  </code></pre>
  
  <p>The problem is that since <code>Html.CheckBox()</code> is rendering a checkbox as well as a hidden input field if I change the state of the textbox the postback value is doubled (ie. "true,false").</p>
  
  <p>I understand why this is done and I'm looking for the best way to parse the current value of the CheckBox during a postback (checked = true, unchecked = false).  Is there another helper method in MVC for this or should I just write my own?</p>