ajax里面的CollapsiblePanelExtender控件控制Label显示文字(显示和隐藏)是呀设置Lable的AssociatedControlID属性为Label所在的Panel
下面是示例代码: <asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<cc1:CollapsiblePanelExtender ID="CollapsiblePanelExtender1"
TargetControlID ="Panel1" ExpandControlID ="Panel2"
CollapseControlID ="Panel2"
Collapsed ="true"
TextLabelID="Label1"
ExpandedText ="隐藏...."
CollapsedText ="显示...."
ImageControlID ="Image1"
ExpandedImage ="~/images/collapse_blue.jpg"
CollapsedImage ="~/images/expand_blue.jpg"
SuppressPostBack ="true"
SkinID ="CollapsiblePanelDemo"
runat="server">
</cc1:CollapsiblePanelExtender>
<%-- <ajaxToolkit:CollapsiblePanelExtender ID="cpeDemo" runat="Server"
TargetControlID="Panel1"
ExpandControlID="Panel2"
CollapseControlID="Panel2"
Collapsed="True"
TextLabelID="Label1"
ImageControlID="Image1"
ExpandedText="(Hide Details...)"
CollapsedText="(Show Details...)"
ExpandedImage="~/images/collapse_blue.jpg"
CollapsedImage="~/images/expand_blue.jpg"
SuppressPostBack="true"
SkinID="CollapsiblePanelDemo" />--%>
<asp:Panel ID="Panel2" CssClass ="collapsePanelHeader" Height ="30px" Width ="100%" runat="server">
<div style="padding:5px; cursor: pointer; vertical-align: middle;">
<div style="float: left;">What is ASP.NET AJAX?</div>
<div style="float: left; margin-left: 20px;">
<asp:Label ID="Label1" runat="server" AssociatedControlID="Panel1"
</div>
<div style="float: right; vertical-align: middle;">
<asp:ImageButton ID="Image1" ImageUrl="~/Images/expand_blue.jpg" AlternateText="(Show Details...)" runat="server"/>
</div>
</div>
</asp:Panel>
<asp:Panel ID="Panel1" CssClass ="collapsePanel" Height ="0px" Width ="100%" runat="server">
<p>
<asp:ImageButton ID="Image2" runat="server" ImageUrl="~/Images/AJAX.gif"
AlternateText="ASP.NET AJAX" ImageAlign="right" />
哈哈o(∩_∩)o...哈哈
</p>
</asp:Panel>