title: asp.net display textbox on item checked
body: <p>So just starting out with asp.net... I want to display my textbox when my checkbox is checked, but this doesn't seem to be working. I also tried with the visible property, but that didn't work either. What am I doing wrong exactly?</p>
  
  <p>Code:</p>
  
  <pre><code>    protected void checked_CheckedChanged(object sender, EventArgs e)
      {
          text.Style["display"] = "block";
      }
  </code></pre>
  
  <p>Layout:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;p&gt;gehuwd/samenwonend&lt;asp:checkbox runat="server" ID="checked" OnCheckedChanged="checked_CheckedChanged"&gt;&lt;/asp:checkbox&gt;
          &lt;/p&gt;
          &lt;asp:TextBox runat="server" ID="text" style="display:none"&gt;&lt;/asp:TextBox&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>