Accordion控件,该控件可用于实现页面的标题和内容的伸缩模式显示。
具体实例代码如下。
具体实例代码如下。
<%
@PageLanguage
=
"
C#
"
AutoEventWireup
=
"
true
"
CodeFile
=
"
AccordionDemo.aspx.cs
"
Inherits = " AccordionDemo " %>
<% @RegisterAssembly = " System.Web.Extensions,Version=1.0.61025.0,Culture=neutral,
PublicKeyToken = 31bf3856ad364e35 "
Namespace = " System.Web.UI " TagPrefix = " asp " %>
<% @RegisterAssembly = " AjaxControlToolkit " Namespace = " AjaxControlToolkit " TagPrefix = " cc1 " %>
<! DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//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" FramesPerSecond ="40" TransitionDuration ="250" AutoSize ="None" >
< Panes >
< cc1:AccordionPane ID ="AccordionPane1" runat ="server" >
< Header >< a href ="" onclick ="returnfalse;" > 第一章 </ 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 ="returnfalse;" > 第二章 </ 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 ="returnfalse;" > 第三章 </ a ></ Header >
< Content >
3.1内容 < br />
3.2内容 < br />
3.3内容 < br />
</ Content >
</ cc1:AccordionPane >
</ Panes >
</ cc1:Accordion >
</ div >
</ form >
</ body >
</ html >
Inherits = " AccordionDemo " %>
<% @RegisterAssembly = " System.Web.Extensions,Version=1.0.61025.0,Culture=neutral,
PublicKeyToken = 31bf3856ad364e35 "
Namespace = " System.Web.UI " TagPrefix = " asp " %>
<% @RegisterAssembly = " AjaxControlToolkit " Namespace = " AjaxControlToolkit " TagPrefix = " cc1 " %>
<! DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//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" FramesPerSecond ="40" TransitionDuration ="250" AutoSize ="None" >
< Panes >
< cc1:AccordionPane ID ="AccordionPane1" runat ="server" >
< Header >< a href ="" onclick ="returnfalse;" > 第一章 </ 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 ="returnfalse;" > 第二章 </ 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 ="returnfalse;" > 第三章 </ a ></ Header >
< Content >
3.1内容 < br />
3.2内容 < br />
3.3内容 < br />
</ Content >
</ cc1:AccordionPane >
</ Panes >
</ cc1:Accordion >
</ div >
</ form >
</ body >
</ html >