title: Determine if CheckBox is checked in ASP.NET
body: <p>I have problem with determine if checkbox is checked on my webpage build in ASP.NET.
  When I render webpage in Page_Load method I check some of checkbox using code like:</p>
  
  <pre><code>checkbox1.Checked = true;
  </code></pre>
  
  <p>On page I have button to process data in form, on click in this button i check if checkbox was checked:</p>
  
  <pre><code>if(checkbox1.Checked == true)
  {
      //do something
  } else {
      //do something else
  }
  </code></pre>
  
  <p>But i found that value which I get from Checked property is always same as I set in first step. That property never returns value of current state of CheckBox.
  And here is my question: Why?</p>
  
  <p>I menaged to bypass that problem by setting checked in different way:</p>
  
  <pre><code>checkbox1.Attributes.Add("checked","true");
  </code></pre>
  
  <p>I don't like when something works but I don't know why so please give me advise what I'm misunderstanding.</p>