Sheikh Rahat Ali
Sheikh Rahat Ali

Reputation: 1333

how to hide a panel in javascript

What is the best approach to show and hide an asp panel which is containing other controls like textbox and label controls

Upvotes: 1

Views: 16928

Answers (2)

Guillaume86
Guillaume86

Reputation: 14400

Using jQuery, you can just switch visibilty:

$('#<%= YourPanel.ClientID %>').hide();
$('#<%= YourPanel.ClientID %>').show();

Edit: jQuery is probably overkill just to hide/show, but if you plan to add more functionality client side, you should consider using it ;)

Upvotes: 4

Bala R
Bala R

Reputation: 108957

Can you try

document.getElementById( 'Panel1ClientId' ).style.display = 'none'; // to hide

and

document.getElementById( 'Panel1ClientId' ).style.display = 'block'; // to show

?

Upvotes: 3

Related Questions