title: Question regarding Visible=false and display:none;
body: <p>If I set some control's property Visible="false", I cant see the control in the HTML generated of my aspx page. But when I use display:none in style tag for that control, I see the control as greyed out in the HTML. Why is that?</p>
  
  <p>Also, If I find some control that is not needed on the page anymore:- </p>
  
  <ol>
  <li>should I comment it out from my page?</li>
  <li>Should I set its property Visible=false"</li>
  <li>Should I set display:none?</li>
  </ol>
  
  <p>What would be the best approach keeping in mind the time constraint and page's heaviness?</p>
  
  <p>Below is the HTML that was generated of my test page:-</p>
  
  <pre><code>&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&gt;
  &lt;title&gt; &lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form id="form1" action="testvisibility.aspx" method="post" name="form1"&gt;
  &lt;div&gt;
  &lt;input id="__VIEWSTATE" type="hidden" value="/wEPDwUKMTY2NDk3NDQzNQ9kFgICAw9kFgQCBw8PFgIeB1Zpc2libGVoZGQCCQ8WAh4Fc3R5bGUFDWRpc3BsYXk6bm9uZTtkZEjYzMWMovvrGmuSrQHwc5ZXgqXCrf+lekz1GgsdjUd+" name="__VIEWSTATE"&gt;
  &lt;/div&gt;
  &lt;div&gt;
  visiblelabel::
  &lt;span id="visiblelabel"&gt;visiblelabel&lt;/span&gt;
  &lt;br&gt;
  labelwithvisiblefalseonaspx::
  &lt;br&gt;
  labelwithdisplaynoneonaspx::
  &lt;div style="display: none;"&gt;
  &lt;span id="labelwithdisplaynoneonaspx"&gt;labelwithdisplaynoneonaspx&lt;/span&gt;
  &lt;/div&gt;
  &lt;br&gt;
  labelwithvisiblefalseonserverside::
  &lt;br&gt;
  labelwithdisplaynoneonserverside::
  &lt;div id="divforlabelwithdisplaynoneonserverside" style="display: none;"&gt;
  &lt;span id="labelwithdisplaynoneonserverside"&gt;labelwithdisplaynoneonserverside&lt;/span&gt;
  &lt;/div&gt;
  &lt;br&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>