• How to use AJAX Toolkit Accordion control in ASP.NET

    by  • June 12, 2013 • Microsoft .NET AJAX, Microsoft ASP.NET • 0 Comments

    AJAX is really an excellent way to create fast and dynamic web pages. In simple words, it allows us to update only a part of the web page and send and receive small amount of data from server instead of updating the whole page and sending and receiving entire data. AJAX Control Toolkit provides a way to build interactive web pages. It contains more than 30 controls and one of them is Accordion control. I have described about how to use CalendarExtender in one of my previous articles.

    Accordion control provides cool functionality as it provides multiple tabs or panes and display content of selected tab or pane and hides contents of all other tabs or panes. It is really a fascinating way to display your data and also helps us to save our space on the page. Well, I am using it in my web pages and I will show you in this article that how easily you can use it in your web page.

    You need to download AjaxControlToolkit, extract the file and add it to your Visual studio Toolbox.

    Follow these steps to add AjaxControlToolkit to your Visual Studio Toolbox

    1. Right click on Toolbox and select Add Tab, Rename the tab AjaxControlToolkit
    2. Right click in the newly created tab and select Choose Items
    3. Browse the folder where you extracted AjaxControlToolkit and select AjaxControlToolkit.dll file.
    4. Press Ok to add AjaxControlToolkit

    Now don’t forget to add following “Register” after “Page” tag at the top of the aspx page

    I have used following CSS for header and header selected for Accordion control.

    Now see the code to use Accordion Control

    ScriptManager control is neccassary to use AJAX functionality. You can see, I have used SqlDataSource to get data from database and bind it to Accordion control.




    Namecheap.com
    Avatar of GetCodeSnippet.com

    About

    GetCodeSnippet.com provides you high quality Microsoft .NET development related articles, tutorials and sample code for ASP.NET, C#, VB.NET, AJAX, WCF, WPF, Web Services, Windows Services, SQL Server and other technologies.

    Leave a Reply