title: Allow Nullable<bool> in ASP.NET MVC form on submission
body: <p>I have a model with some properties being of type Nullable. </p>
  
  <pre><code>public Nullable&lt;bool&gt; Continuing { get; set; }
  public Nullable&lt;bool&gt; Incomplete { get; set; }
  
  //..etc other properties omitted for brevity
  </code></pre>
  
  <p>I have successfully bound this in a form with 3 radio buttons but when I submit the form, <code>ModelState.IsValid</code> returns false. </p>
  
  <p>The controller:</p>
  
  <pre><code>        [HttpPost]
          public ActionResult CreateSub(MyModel model)
          {
              var errors = ModelState
                          .Where(x =&gt; x.Value.Errors.Count &gt; 0)
                          .Select(x =&gt; new { x.Key, x.Value.Errors })
                          .ToArray();
  </code></pre>
  
  <p>I had a look at the errors and it is saying that the value  <code>'null'</code> is not allowed for the properties of type <code>Nullable&lt;bool&gt;</code> - I don't seem to understand why.</p>
  
  <p>the error:</p>
  
  <p><img src="https://i.stack.imgur.com/LciG6.png" alt="enter image description here"></p>
  
  <p>EDIT:</p>
  
  <p>This is how I am binding the properties to the radios:</p>
  
  <pre><code>        &lt;div class="btn-group" data-toggle="buttons"&gt;
                  @Html.RadioButtonFor(x =&gt; x.Continuing, true, new {@class = "Continuing-true", style="visibility: hidden; margin-left:-13px"})
                  &lt;label class="btn-cohort btn btn-sm btn-default @if(Model.Continuing.HasValue &amp;&amp; Model.Continuing.Value) { &lt;text&gt;btn-custom-green active&lt;/text&gt; } " data-value="true"&gt;
                          &lt;input type="radio" name="options" value="true" /&gt;
                          T
                  &lt;/label&gt;
  
                  @if(!Model.Continuing.HasValue) { 
                      @Html.RadioButtonFor(x =&gt; x.Continuing, "null", new {@checked = "checked", @class = "Continuing-null", style="visibility: hidden; margin-left:-13px"}) 
                  } else {
                      @Html.RadioButtonFor(x =&gt; x.Continuing, "null", new {@class = "Continuing-null", style="visibility: hidden; margin-left:-13px"}) 
                  }
                  &lt;label class="btn-cohort btn btn-sm btn-default btn-n  @if(!Model.Continuing.HasValue) { &lt;text&gt;active&lt;/text&gt; } " data-value="null"&gt;
                          &lt;input type="radio" name="options" value="null"/&gt;
                          N
                  &lt;/label&gt;
  
                  @Html.RadioButtonFor(x =&gt; x.Continuing, false, new {@class = "Continuing-false", style="visibility: hidden; margin-left:-13px"})
                  &lt;label class="btn-cohort btn btn-sm btn-default @if(Model.Continuing.HasValue &amp;&amp; !Model.Continuing.Value) { &lt;text&gt;btn-custom-red active&lt;/text&gt; } " data-value="false"&gt;
                          &lt;input type="radio" name="options" value="false" /&gt;
                          F
                  &lt;/label&gt;
              &lt;/div&gt;
  </code></pre>