i want a javascript code to hide/display a panel
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
I tried this code..but it does not work…
<script language="javascript" type = "text/javascript">
var gridview = (document.getElementById("#<%= gridview1.ClientID %>")) ? true : false;
if (gridview) {
document.getElementById("Panel1").style.display = 'inline';
}
else {
document.getElementById("Panel1").style.display = 'none';
}
</script>
Remove the
#indocument.getElementById("#<%= gridview1.ClientID %>").