2011-03-09 101 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