an ASP.NET Open Source CMS & eCommerce platform
Search:
Skip Navigation LinksHome > DotShoppingCart Forums > Development > General Programming > Ajax Toolkit Accordian control
Last Post 7/21/2009 8:25:30 AM By macker999. 2 replies.
7/20/2009 9:30:13 AM
macker999
Posts: 30
Joined: 10/11/2008
Ajax Toolkit Accordian control
Hi Luke
 
I tried adding an accordian ajax control to our website on the top of out left navigation
 
I get the following javascript error "AjaxControlToolkit' is undefined". and it does not work.
When i enable the page editor it works. 
 
Is there anything i can do to fix this?
 
This is an example of the code I am using
 
 <ajaxc:ToolkitScriptManager runat="server" ID="ScriptManager1" />
   
   
    
        <ajaxc:Accordion ID="MyAccordion" runat="server" SelectedIndex="0"
            HeaderCssClass="accordionHeader" HeaderSelectedCssClass="accordionHeaderSelected"
            ContentCssClass="accordionContent" FadeTransitions="false" FramesPerSecond="40"
            TransitionDuration="250" AutoSize="None" RequireOpenedPane="false" SuppressHeaderPostbacks="true">
           <Panes>
            <ajaxc:AccordionPane ID="AccordionPane1" runat="server">
                <Header><a href="" class="accordionLink">1. Accordion</a></Header>
                <Content>
                    The Accordion is a web control that allows you to provide multiple panes and display them one at a time.
                    It is like having several <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="/CollapsiblePanel/CollapsiblePanel.aspx" Text="CollapsiblePanels" />
                    where only one can be expanded at a time.  The Accordion is implemented as a web control that contains
                    AccordionPane web controls. Each AccordionPane control has a template for its Header and its Content.
                    We keep track of the selected pane so it stays visible across postbacks.
                    <a href="test.aspx?id=0">test</a>
                </Content>
            </ajaxc:AccordionPane>
         
            </Panes>
        </ajaxc:Accordion>
         
 
Thanks
 
 
 
7/20/2009 11:19:41 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Ajax Toolkit Accordian control
The script manager is not enabled by default. The reason is to improve performance during the first page hit. You can enable it by setting the following in the user control constructor.
 
 
public partial class View_EditGroup : PageBlockUserControl {
    private int groupId = 0, parentGroupId = 0;
 
    public View_EditGroup() {
        ScriptManagerRequired = true;
    }
 
BTW, we are phasing out AjaxControlToolkit and replace it with JQuery. You can easily do the accordian effect with a few lines of javascript.  
DotShoppingCart Staff
7/21/2009 8:25:30 AM
macker999
Posts: 30
Joined: 10/11/2008
Re: Ajax Toolkit Accordian control
Thanks Luke
 
 
I went with the jquery accordion.