Click here to Skip to main content
Licence CPOL
First Posted 4 Oct 2007
Views 88,871
Downloads 1,809
Bookmarked 20 times

How To Use Accordion and Accordion Pane Controls in Ajax Toolkit

By | 11 Oct 2007 | Article
Accordion and Accordion Pane Controls add a really cool and sexy look and feel to your ASP.NET application.
Screenshot - aa.jpg

Introduction

You can use Accordion and Accordion Pane Controls to add a really cool and sexy look and feel to your ASP.NET application. I will teach you how to use these controls into your Ajax enabled ASP.NET application.

Now let's start.

Before you start, check if you have installed the ASP.NET Ajax extension 1.0 and Ajax Controls Toolkit. You can download them from here.

Steps

  1. Open Visual Studio 2005. 
  2. Select ASP.NET Ajax Enabled Website from Website project templates.
  3. Switch to your design mode.You will see the Script Manager Control on your Page.
    Just don't bother about it. 
  4. Add an Update Panel from Ajax Extension ToolBox Tab. 
  5. Now you will see that Update Panel will be added to your Page. 
  6. Select that Update Panel Control. 
  7. Now add Accordion Control from Ajax Control if you have added Ajax Controls already. If not, then right click on your toolbox, select Add Tab. Name it Ajax Controls, and then again right click inside that newly created Tab and choose New Item, then Locate your AjaxControlToolKit Directory from your hard drive and follow this C:\AjaxControlToolKit\SampleWebsite\bin (this is my path, yours may be different). Now you will see a DLL named AjaxControlToolKit.dll and click Ok.
  8. Controls will be added. 
  9. Now add the following lines.

Code

<cc1:AccordionID="Accordion1" runat="server"
 SelectedIndex="0" FadeTransitions="true"
 FramesPerSecond="40"TransitionDuration="250"
 AutoSize="None"ContentCssClass="Content" HeaderCssClass="HEADER" > 
<Panes>

<cc1:AccordionPane
ID="AccordionPane2" runat="server"> 

<Header> 
<a href=""onclick="return false;" class="Link" > 
Open 
</a> 
</Header> 
<Content> 
<div> 
First Content Area First Content AreaFirst Content Area First Content Area 
First Content Area</div> 
</Content> 
</cc1:AccordionPane> 
<cc1:AccordionPaneID="AccordionPane1" runat="server"> 
<Header> 
<a href=""onclick="return false;" class="Link" > 
Open 
</a> 
</Header> 
<Content> 
<div> 
Second Content Area Second ContentArea Second Content Area Second Content 
	Area Second Content Area 
</div> 
</Content> 
</cc1:AccordionPane> <cc1:AccordionPaneID="AccordionPane3" runat="server"> 
<Header> 
<a href=""onclick="return false;" class="Link" > 
Open 
</a> 
</Header> 
<Content> 
<div> 
Third Content Area Third Content AreaThird Content Area Third Content 
	Area Third Content Area 
</div> 
</Content> 
</cc1:AccordionPane> <cc1:AccordionPaneID="AccordionPane4" runat="server"> 
<Header> 
<a href=""onclick="return false;" class="Link" > 
Open 
</a> 
</Header> 
<Content> 
<div> 
Fourth Content Area Fourth Content AreaFourth Content Area 
Fourth Content Area Fourth Content Area 
</div> 
</Content> 
</cc1:AccordionPane> 
</Panes>
</cc1:Accordion> 

I have included the *.css file and the source code. You can download it from the link at the top of this article and have a look at it. Hopefully this will help you understand Accordion control with Ajax.NET.

Visit http://www.exposecode.com.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

MussaratAziz

Web Developer

Pakistan Pakistan

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 1 PinmemberLovee20107:13 29 May '11  
GeneralMy vote of 1 PinmemberCameleon_17017:13 10 Jul '09  
QuestionOn Click event for accordian header Pinmembergoudaraghu20:46 12 Jan '09  
QuestionAccordion AJAX Control Pinmembermojtaba fallah1:06 28 Jul '08  
AnswerRe: Accordion AJAX Control Pinmemberlmnh22:08 28 Sep '10  
GeneralDemo PinmemberDewey21:34 5 Oct '07  
GeneralRe: Demo PinmemberMussaratAziz2:02 6 Oct '07  
GeneralRe: Demo Pinmemberfwsouthern13:36 11 Oct '07  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 11 Oct 2007
Article Copyright 2007 by MussaratAziz
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid