Introduction:

In this article I am going to discuss the Accordion control of the Ajax toolkit.

Below I have explained the steps to do the demo
I will first discuss the first item that is accordion.

Accordion:

The Accordion is a web control that allows you to provide multiple panes
and display them one at a time. It is like having several CollapsiblePanels where only one can
be expanded at a time. The Accordion is implemented as a web control that contains AccordionPane
web controls. Each AccordionPane control has a template for its Header and its Content. We keep
track of the selected pane so it stays visible across postbacks.

To see the accordion demo follow the steps:
The content template is used to put the content in the panes

The header template is used to write the heading for panes
For This add the code as:

<asp:Accordion ID="Accordion1" runat="server" HeaderCssClass="accordianHead" AutoSize="None" SelectedIndex="0" FadeTransitions="true">
<Panes
>
<asp:AccordionPane ID="About" runat
="server">
<Header><a>Aout</a></Header
>
<Content
>

<pre>

First pane The Accordion is a web control that allows you to provide multiple panes and display them one at a time. It is like having several CollapsiblePanels where only one can be expanded at a time. The Accordion is implemented as a web control that contains AccordionPane web controls. Each AccordionPane control has a template for its Header and its Content. We keep track of the selected pane so it stays visible across postbacks.

</pre>
</Content>
</asp:AccordionPane>
<asp:AccordionPane ID="Code" runat="server">
<Header><a>Code</a></Header>
<Content>
<pre
>


Second pane The Accordion is a web control that allows you to provide multiple panes and display them one at a time. It is like having several CollapsiblePanels where only one can be expanded at a time. The Accordion is implemented as a web control that contains AccordionPane web controls. Each AccordionPane control has a template for its Header and its Content. We keep track of the selected pane so it stays visible across postbacks.

</pre>
</Content>
</asp:AccordionPane>
<asp:AccordionPane ID="Resources" runat="server" >
<Header><a>Resources</a></Header>
<Content>
<pre> <ul><li><a href="http://www.asp.net/ajax/videos/how-do-i-use-the-aspnet-ajax-accordion-control"> A Small Vedio</a></li>
<li><a href="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2009/05/08/open-ajax-accordion-panes-on-mouseover.aspx">onHover Show Pane </a></li>
</ul></pre></Content>
</asp:AccordionPane>
</Panes>
</asp:Accordion
>


Note: I am not providing the css for you

Output:

accordin3.gif

After clicking on the code About pane is collapsed and Code pane is selected, same for others also.