Accordion控件,該控件可用於實現頁面的標題和內容的伸縮模式顯示。
具體實例代碼如下。
<%...@ Page Language="C#" AutoEventWireup="true" CodeFile="AccordionDemo.ASPx.cs"
Inherits="AccordionDemo" %>
<%...@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="ASP" %>
<%...@ Register Assembly="AjaxControlToolkit" Namespace="AJaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHtml 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xHtml1-transitional.dtd">
<html XMLns="http://www.w3.org/1999/xHtml" >
<head runat="server">
<title>無標題頁</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager id="ScriptManager1" runat="server"></ASP:ScriptManager>
<cc1:Accordion ID="MyAccordion" runat="server" SelectedIndex="0"
FadeTransitions="false" FramesPerSeco
nd="40" TransitionDuration="250" AutoSize="None">
<Panes>
<cc1:AccordionPane ID="AccordionPane1" runat="server">
<Header><a href="" onclick="return false;">第一章</a></Header>
<Content>
1.1內容<br />
1.2內容<br />
1.3內容<br />
</Content>
</cc1:AccordionPane>
<cc1:AccordionPane ID="AccordionPane2" runat="server">
<Header><a href="" onclick="return false;">第二章</a></Header>
<Content>
2.1內容<br />
2.2內容<br />
2.3內容<br />
</Content>
</cc1:AccordionPane>
<cc1:AccordionPane ID="AccordionPane3" runat="server">
<Header><a href="" onclick="return false;" >第三章</a></Header>
<Content>
3.1內容<br />
3.2內容<br />
3.3內容<br />
</Content>
</cc1:AccordionPane>
</Panes>
</cc1:Accordion>
</div>
</form>
</body>
</Html>