The Ajax Control Toolkit contains controls that you can use to build highly responsive and interactive Ajax-enabled Web applications. The Accordion Control manages your content into expandable Panes which can be clicked to make the content of that Pane visible and hiding all the other Panes.

An Accordion Control contains several Accordion Panes and displays a single AccordionPane at a time. Each AccordionPane contains both a header and content tag. We can fill each header and content tag through programmatically to Accordion Control.
vb.net Dim pane1 As New AjaxControlToolkit.AccordionPane()
pane1.ID = "pane1"
pane1.HeaderContainer.Controls.Add(New LiteralControl("Pane 1"))
pane1.ContentContainer.Controls.Add(New LiteralControl("This is Accordion Pane No 1"))
Accordion1.Panes.Add(pane1)
AjaxControlToolkit.AccordionPane pane1 = new AjaxControlToolkit.AccordionPane();
pane1.ID = "pane1";
pane1.HeaderContainer.Controls.Add(new LiteralControl("Pane 1"));
pane1.ContentContainer.Controls.Add(new LiteralControl("This is Accordion Pane No 1"));
Accordion1.Panes.Add(pane1);
The following Asp.Net Ajax program shows how to set up an Accordion control with 4 panes in a web application. To use the Ajax Control Toolkit in your Visual Studio project, you should add reference to the AjaxControlToolkit.dll in your project.
Default.aspx
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %> Untitled Page
Click the following links to see full source code