如何在javascript中隐藏面板

如何在javascript中隐藏面板,javascript,asp.net,Javascript,Asp.net,显示和隐藏包含其他控件(如textbox和label控件)的asp面板的最佳方法是什么 document.getElementById( 'Panel1ClientId' ).style.display = 'none'; // to hide 及 你能试试吗 document.getElementById( 'Panel1ClientId' ).style.display = 'none'; // to hide 及 ?使用jQuery,您只需切换Visibility: $('#<%

显示和隐藏包含其他控件(如textbox和label控件)的asp面板的最佳方法是什么

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

你能试试吗

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


使用jQuery,您只需切换Visibility:

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

编辑:jQuery很可能只是为了隐藏/显示,但是如果你打算增加客户端的功能,你应该考虑使用它。p> 使用jQuery,您只需切换Visibility:

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

编辑:jQuery很可能只是为了隐藏/显示,但是如果你打算增加客户端的功能,你应该考虑使用它。p> 我甚至建议将面板的ClientdMode设置为静态。如果他使用.net 4.0,最好去掉asp.net标记,我甚至建议将面板的ClientdMode设置为静态。如果他使用.net 4.0,最好去掉asp.net标记