title: Enable and disable TextBox with a checkbox in C#
body: <p>I want to Enable Disable my textbox because either user can enter the call preparation time in the text box or it can select the checkbox for unlimited time.</p>
  
  <p>My aspx code</p>
  
  <pre><code>&lt;table width="100%" cellpadding="0" cellspacing="0" border="0" align="center"&gt;
      &lt;tr class="rowPadding"&gt;
          &lt;td class="labelStyle" width="240px"&gt;
              &lt;asp:Label runat="server" ID="lblPrepTime" Width="230px" meta:resourcekey="lblPrepTimeResource1"&gt; Call preparation time (seconds): &lt;/asp:Label&gt;
          &lt;/td&gt;
          &lt;td class="textBoxStyle" width="100px"&gt;
              &lt;asp:TextBox runat="server" ID="txtPrepTime" Width="80px" meta:resourcekey="txtPrepTimeResource1"&gt;&lt;/asp:TextBox&gt;
          &lt;/td&gt;
          &lt;td class="labelPaddingRight" width="300px"&gt;
              &lt;asp:CheckBox runat="server" ID="cbUnlimited" Text="unlimited" meta:resourcekey="cbUnlimitedResource1" /&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>my code behind is</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
     try
     {
        if (!IsPostBack)
        {
            BindAllCallSettings();
        }
     }
     catch (Exception ex)
     {
           Logger.WriteException(ex);
     }
  }
  </code></pre>