title: Want to make the visibility true from client side of the control which made invisible from server side
body: <p>I have a text box in a page. Whose visibility is set false from the server side. Now I want to make it visible from client side by using java-script. (Any post back or partial post back can not be implemented in this case.)</p>
  
  <pre><code>&lt;%@ Page Title="Home Page" Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&gt;
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
      &lt;head id="Head1" runat="server"&gt;
          &lt;title&gt;ControlVisibilityClientSide&lt;/title&gt;
              &lt;script type="text/javascript"&gt;
                  function toggleVisibility(controlId)
                  {
                      var control = document.getElementById(controlId);
                      if(control.style.visibility == "visible" || control.style.visibility == "")
                          control.style.visibility = "hidden";
                      else
                          control.style.visibility = "visible";
                  }
              &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;form id="form1" runat="server"&gt;
              &lt;div&gt;
                  &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;input type="button" ID="btnShowHide" value="Show/Hide" onclick="toggleVisibility('TextBox1');" /&gt;
              &lt;/div&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This is working fine.</p>
  
  <p>But when I use </p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  
  public partial class _Default : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          TextBox1.Visible = false;
      }
  }
  </code></pre>
  
  <p>The above code is not working at all.</p>
  
  <p>Can any one please help me out from this problem or any suggestion will be appreciated.</p>