title: Blazor checkbox binding is not working - server-side
body: <p><strong>TLDR;</strong>
  It is like the string/textbox binding works just fine on input controls, but the checkbox binding backed by Boolean properties does not work.  I know the binding for checkbox values needs to used a 'checked' attribute instead of a 'value' attribute, but Blazor is supposed to handle that across different control types.</p>
  
  <p>I'm doing some Blazor work (server-side app) with RC1 and cannot seem to get Boolean values binding to an input checkbox control.  I believe that the syntax being used is correct (see below).  As a simple test, I created a new project and simply replaced the index.razor page with the sample code below.  When you run it, notice:</p>
  
  <ol>
  <li>The "Test Value" for the textbox input control initializes just fine.</li>
  <li>The checkbox's initial value is true, but the checkbox is not checked.</li>
  <li>Change the textbox input control's text and then change control
  focus.  Notice a message gets printed in the Debug window in the Output
  tab of Visual Studio (Expected behavior)</li>
  <li>Change the checkbox input control's value (checking or uncheck) and then change control focus.  Notice that there no message appears in the Debug window in the Output tab of Visual Studio (Not expected behavior). </li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/nk5gE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/nk5gE.png" alt="Initial page load shows test string value but checkbox is not checked"></a></p>
  
  <pre><code>@page "/"
  
  &lt;div class="form-group"&gt;
      &lt;label for="last-name"&gt;Textbox Binding Test&lt;/label&gt;
      &lt;input @bind="TestString" type="text" class="form-control" id="last-name" placeholder="Enter Last Name" /&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
      &lt;label for="send-email-updates"&gt;Checkbox Binding Test&lt;/label&gt;
      &lt;input type="checkbox" bind="@TestBool" id="send-email-updates" /&gt;
  &lt;/div&gt;
  
  @code {
      private bool _testBool = true;
      protected bool TestBool
      {
          get { return _testBool; }
          set
          {
              _testBool = value;
              System.Diagnostics.Debug.WriteLine($"Value of {nameof(TestBool)} = {value}");
          }
      }
  
      private string _testString = "Test Value";
      protected string TestString
      {
          get { return _testString; }
          set
          {
              _testString = value;
              System.Diagnostics.Debug.WriteLine($"Value of {nameof(TestString)} = {value}");
          }
      }
  }
  </code></pre>
  
  <p>This behavior was observed regardless of making the properties public, used auto-properties (no private variables), or removed the control name/id attribute values.  This seems to happen regardless of whether I use the @code directive on the page or separate out a viewmodel that inherits from ComponentBase.</p>
  
  <p>The bottom line is that I'm able to get text-based values when a user submits the form, but all the Boolean properties seem to remain as they were when first initialized.</p>