title: How to handle Booleans/CheckBoxes in ASP.NET MVC 2 with DataAnnotations?
body: <p>I've got a view model like this:</p>
  
  <pre><code>public class SignUpViewModel
  {
      [Required(ErrorMessage = "Bitte lesen und akzeptieren Sie die AGB.")]
      [DisplayName("Ich habe die AGB gelesen und akzeptiere diese.")]
      public bool AgreesWithTerms { get; set; }
  }
  </code></pre>
  
  <p>The view markup code:</p>
  
  <pre><code>&lt;%= Html.CheckBoxFor(m =&gt; m.AgreesWithTerms) %&gt;
  &lt;%= Html.LabelFor(m =&gt; m.AgreesWithTerms)%&gt;
  </code></pre>
  
  <p>The result:</p>
  
  <p>No validation is executed. That's okay so far because bool is a value type and never null. But even if I make AgreesWithTerms nullable it won't work because the compiler shouts </p>
  
  <p>"Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions."</p>
  
  <p>So, what's the correct way to handle this?</p>