title: checkbox autopostback without refreshing page asp net
body: <p>I have this checkbox  that I need to be <code>AutoPostBack="True"</code> so that I can trigger <code>OnCheckedChanged="chkCompany_OnCheckedChanged"</code>. The problem is that I dont want the page to be refreshed and redirected, I want the user to stay put exactly where they are.</p>
  
  <p>ASPX:</p>
  
  <pre><code>&lt;asp:CheckBox OnCheckedChanged="chkCompany_OnCheckedChanged" AutoPostBack="True" CssClass="chkCompany" ClientIDMode="Static" ID="chkCompany" runat="server" /&gt;
  </code></pre>
  
  <p>C#:</p>
  
  <pre><code>protected void chkCompany_OnCheckedChanged(object sender, EventArgs e)
      {
          if (chkCompany.Checked)
          {
              txtName.Visible = false;
          }
  
          else
          {
              txtName.Visible = true;
          }
      }
  </code></pre>