title: ASP.NET checkbox autopostback not working
body: <p>I designed a simple page with, two text boxes, one checkbox, one button, and one label.</p>
  
  <p>When I start I want to check the checkbox to make the button enabled, and then enter two numbers into the two textboxes, click the button to do addition, and show the result in the label.</p>
  
  <p>But when I click the checkbox the page postback is not working; it's not writing <em>Page is posted back</em> on the page and the button is still disabled.</p>
  
  <p>However, if I make the button enabled and do the addition it invokes the page postback and also invokes the <code>checkedchanged</code> method.</p>
  
  <pre><code>&lt;asp:TextBox ID="txtFirst" runat="server"&gt;&lt;/asp:TextBox&gt;
  &lt;asp:TextBox ID="txtSecond" runat="server"&gt;&lt;/asp:TextBox&gt;
  &lt;asp:Label ID="result" runat="server"&gt;&lt;/asp:Label&gt;
  
  &lt;td&gt;
      &lt;asp:CheckBox ID="cboptions" runat="server" AutoPostBack="True"   
          onCheckedChanged="cboptions_CheckedChanged" /&gt;
  &lt;/td&gt;
  
  &lt;asp:Button ID="submit" runat="server" Text ="addition" onclick="Button_Click"/&gt;
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      if (Page.IsPostBack == true)
      {
          Response.Write("Page is posted back");
      }
  }
  protected void cboptions_CheckedChanged(object sender, EventArgs e)
  {
      submit.Enabled = cboptions.Checked;
  }
  protected void submit_Click(object sender, EventArgs e)
  {
      int a = Convert.ToInt32(txtFirst.Text);
      int b = Convert.ToInt32(txtSecond.Text)+a;
      result.Text = b.ToString();
  }
  </code></pre>