Search code examples
asp.netajaxcontroltoolkit

How to use .Net Ajax Accordion to show Short Description to Long


I'm a newbie at ASP and Ajax, Please I want to use Accordion Tool from Ajax Control Toolkit, to show a short and long description text.

thanks


Solution

  • <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Accordion Tutorial</title>
        <style type="text/css">  
            .accordion {  
                width: 400px;  
            }  
    
            .accordionHeader {  
                border: 1px solid #2F4F4F;  
                color: white;  
                background-color: #2E4d7B;  
                font-family: Arial, Sans-Serif;  
                font-size: 12px;  
                font-weight: bold;  
                padding: 5px;  
                margin-top: 5px;  
                cursor: pointer;  
            }  
    
            .accordionHeaderSelected {  
                border: 1px solid #2F4F4F;  
                color: white;  
                background-color: #5078B3;  
                font-family: Arial, Sans-Serif;  
                font-size: 12px;  
                font-weight: bold;  
                padding: 5px;  
                margin-top: 5px;  
                cursor: pointer;  
            }  
    
            .accordionContent {  
                background-color: #D3DEEF;  
                border: 1px dashed #2F4F4F;  
                border-top: none;  
                padding: 5px;  
                padding-top: 10px;  
            }  
        </style>  
    </head>
    <body>
        <form id="form1" runat="server">
            <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
            <div>
                <asp:Accordion ID="Accordion1" runat="server"
                    SelectedIndex="0"
        HeaderCssClass="accordionHeader"
        HeaderSelectedCssClass="accordionHeaderSelected"
        ContentCssClass="accordionContent"
        AutoSize="None"
        FadeTransitions="true"
        TransitionDuration="250"
        FramesPerSecond="40"
        RequireOpenedPane="false"
        SuppressHeaderPostbacks="true" Height="367px" Width="540px">
    
        <Panes>  
        <asp:AccordionPane ID="AccordionPane1" runat="server">  
            <Header>Pane 1</Header>  
            <Content> 
                 This is pane 1 
            </Content>  
        </asp:AccordionPane>  
        <asp:AccordionPane ID="AccordionPane2" runat="server">  
            <Header>Pane 2</Header>  
            <Content>  
                 This is pane 2
           </Content>  
        </asp:AccordionPane>  
        <asp:AccordionPane ID="AccordionPane3" runat="server">  
            <Header>Pane 3</Header>  
            <Content>
                This is pane 3  
            </Content>  
        </asp:AccordionPane>  
    </Panes>  
    
           </asp:Accordion>
    
    
    
            </div>
        </form>
    </body>
    </html>
    

    Can you please go through the link

    http://www.ajaxtutorials.com/controls/ajax-accordion-control-tutorial-asp-net-4-0/

    And this is the documentation provided by Ajax http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/Accordion/Accordion.aspx