2011-03-09 143 views

回答

3

你可以尝试

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

最好的方法
document.getElementById('Panel1ClientId').style.display = 'block'; // to show 

4

使用jQuery,你可以切换公开程度:

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

编辑:jQuery的可能是矫枉过正只是隐藏/显示,但如果你计划添加更多功能的客户端,您应该考虑使用它;)

+2

我甚至会建议将面板的ClientIDMode设置为静态。 – 2011-03-09 13:25:48

+0

好主意摆脱asp.net标签汤(如果他使用.NET 4.0) – Guillaume86 2011-03-09 13:28:10