You can toggle the display of an HTML element easily by toggling its style display
value between 'none' and ''.
JavaScript
function ToggleDisplay(elemId)
{
var elem = document.getElementById(elemId);
elem.style.display = (elem.style.display != 'none') ? 'none' : '';
}
ASPX
<asp:LinkButton ID="lbToggleDisplay" runat="server"
OnClientClick="ToggleDisplay('pnlToggleDisplay'); return false;">Toggle
Display</asp:LinkButton>
<asp:Panel ID="pnlToggleDisplay" runat="server">
Panel content here!
</asp:Panel>
0 comments:
Post a Comment