| Author: Lalji 23 Oct 2009 | Member Level: Diamond | Rating:  Points: 2 |
You Can Try this code sample
<script language="javascript"> imageX='plus'; function toggleDisplay(e){ element = document.getElementById(e).style; if (element.display=='none') {element.display='block';} else {element.display='none';} if (imageX=='plus') {document.getElementById('imagePM').src='minus.bmp';} else {document.getElementById('imagePM').src='plus.bmp';} } </script> <a title="Show Tables" href="javascript:toggleDisplay('table1')"><img border="0" src="plus.bmp" id=imagePM></a> <table> <tr> <td>alway show this table </td> </tr> </table> <div style="display:none;" id=table1> <table> <tr> <td>table one</td> </tr> </table> </div>
|
| Author: Chandra Shekar.Y 23 Oct 2009 | Member Level: Gold | Rating:  Points: 2 |
Hi
function toggle(btnClicked) { var tblObject = document.getElementById('table1'); if(tblObject == null) { return; } tblObject.style.display = (tblObject.style.display == '') ? 'none' : ''; btnClicked.src = (tblObject.style.display == '') ? 'minus.jpg' : 'plus.jpg'; }
<img border="0" src="plus.jpg" id=imagePM onclick="toggle(this);" style="cursor:pointer">
<table> <tr> <td>Default Visble Table </td> </tr> </table>
<table style="display:none;" id=table1> <tr> <td>Table Which is hidden</td> </tr> </table>
|
| Author: Chandru 23 Oct 2009 | Member Level: Silver | Rating:  Points: 2 |
Just declare runat=server and id's in table tag
in codebehind, table.style.add("display","none"); table.style.add("display","block");
Chandru SilverlightScripting.com
|