You are here:   Home
Register  |  Login
 RSS Subscribe
Minimize
 Blog Calendar
Minimize
 Share This
Minimize
 Captured Technology - Blog
Minimize
Feb 11

Written by: Steve Patterson
2/11/2010 3:32 PM  RssIcon

Using the ASP.Net Ajax Accordion

It was suggested that we utilize the Ajax Accordion control in a recent project and although the software is easy to install finding decent documentation on a quick solution was not as simple. I did finally stumble upon a couple of examples and modified the code from them to come up with an easy way to implement an image based menu with the accordion style navigation.

The first thing to do is register the Ajax Control Kit in the page header.

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit"%>

Place the Script Manage on the page itself or on the Master Page.Placing the Script Manager on the Master Page worked well in our case as multiple pages used Ajax .

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>        

The main body of code contains the Accordion definition, a Panes area, an Accordion Pane definition, a Header, a Content area, and closing tags. The unique thing that we did was to place an asp image object within the header group instead of text. Our content area also contained a user control but the links of the menu could have been created directly on the page just as well.

    <ajaxToolkit:Accordion ID="Accordion1" runat="server" FadeTransitions="True" 
    SelectedIndex="0" TransitionDuration="100"  HeaderCssClass="accordionHeader" 
    ContentCssClass="accordionContent" AutoSize="None" ToolTip="Something">
    <Panes> 
    <ajaxToolkit:AccordionPane id="AccordionPane5" runat="server">
    <Header><asp:Image runat="server" AlternateText="Some Text" ImageUrl="~/Images/Menu1.png" />    
    </Header>
    <Content>
    ...
    ... Links to Menu items.
    ...
    </Content>
    </ajaxToolkit:AccordionPane>
    </Panes> 
    </ajaxToolkit:Accordion>

Tags:
Categories:

4 comment(s) so far...


Gravatar

Re: Using the ASP.Net Ajax Accordion

I did finally stumble upon a couple of examples and modified the code from them to come up with an easy way to implement an image based menu with the accordion style navigation.

By Dr Hanookai on   2/12/2010 10:21 AM
Gravatar

Re: Using the ASP.Net Ajax Accordion

thanks for the code.

By dhruwin on   2/27/2010 9:09 AM
Gravatar

canon inkjet cartridges

Thank you for all the great posts from last year! I look forward to reading your blog, because they are always full of information that I can put to use. Thank you again, and God bless you in 2010.

By canon inkjet cartridges on   3/8/2010 12:47 AM
Gravatar

Re: Using the ASP.Net Ajax Accordion

hello
my friends
i am using a Accordion AJAX Control in current project but when add a asp.net server control like gridview into content element of it ,i am facing with errors in code behind part ANYWHERE used gridview..
please guide me about this problem
thanks very much

By Venice Hotels on   7/22/2010 4:11 AM

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment   Cancel 
 Blog Directory
Minimize
 Mobile Version
Minimize
Add CapturedTech - Technology Mippin widget
 Translate
Minimize
 Sponsors
Minimize
AbeBooks.com &#8211; Textbooks

u comment, i follow