title: Unhide ASP Textbox control in Javascript Function
body: <p>I have the following control:</p>
  
  <pre><code>&lt;asp:TextBox ID="textbox1" runat="server" Width="95px" MaxLength="6" /&gt;
  </code></pre>
  
  <p>which i would like to be hidden/invisible on page load, and have the textbox appear after clicking a button/running some javascript without reloading the page.</p>
  
  <p>Here's my current button:</p>
  
  <pre><code>&lt;asp:Button ID="cmdShowBox" runat="server" Text="Show Button" onclick="showBox(); return false"  /&gt;
  </code></pre>
  
  <p>and lastly here's my current javascript function:</p>
  
  <pre><code>                function showBox() {
                  var theControl = document.getElementById("&lt;%= textbox1.ClientID %&gt;");
                  theControl.style.display = "none";
  
  
                  }
  </code></pre>
  
  <p>I was starting with just showing the box on load, then trying to click a button to make it hide, but I can't even get that to work :(  When I run the code as it is above I get a server error which says</p>
  
  <p>Compiler Error Message: BC30451: Name 'textbox1' is not declared.</p>
  
  <p>Thanks for any help/advice.</p>