Javascript Code to hide and display a panel
<p>i want a javascript code to hide/display a panel
<br>
The panel has a grid if the grid has data...then the panel should be displayed
and if the grid is empty then the panel should be hidden </p>

<p>I tried this code..but it does not work...</p>

<pre><code>&lt;script language="javascript" type = "text/javascript"&gt;
    var gridview = (document.getElementById("#&lt;%= gridview1.ClientID %&gt;")) ? true : false;
    if (gridview) {
        document.getElementById("Panel1").style.display = 'inline';
        }
    else {
  document.getElementById("Panel1").style.display = 'none';
    }
&lt;/script&gt; 
</code></pre>
