banner ad
We are excited to announce that the ASP.NET Forums are moving to the new Microsoft Q&A experience. Learn more >
ASP.NET Forums/General ASP.NET/ASP.NET AJAX + Ajax Control Toolkit (ACT)/Cannot Get AJAX Control Toolkit's Accordion to Work

Cannot Get AJAX Control Toolkit's Accordion to Work RSS

19 replies

Last post Dec 05, 2013 05:32 AM by shreeharshas

  • brianelliott brianelliott

    None

    0 Points

    10 Posts

    Re: Cannot Get AJAX Control Toolkit's Accordion to Work

    Jan 04, 2010 01:14 PM|brianelliott|LINK

    With the updatepanel still in the coding, I receive the same error (that it's an unknown server tag).

    Without the update panel, it shows the Arkansas header and content and the Massachusetts Header, but I can't click the Massachusetts header to expand it (essentially, I'm back where I was before the updatepanel).

  • UstesG UstesG

    Participant

    1470 Points

    554 Posts

    Re: Cannot Get AJAX Control Toolkit's Accordion to Work

    Jan 04, 2010 01:33 PM|UstesG|LINK

    Do you have this in your web config:

     

    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>


     

    Please Mark as Answer if You Find Useful!
    But don't expect me to do your job!
  • brianelliott brianelliott

    None

    0 Points

    10 Posts

    Re: Cannot Get AJAX Control Toolkit's Accordion to Work

    Jan 04, 2010 01:59 PM|brianelliott|LINK

    How would I go about placing this in my web.config file?  Here's what's in it so far:

    <?xml version="1.0"?>
    <configuration>
    	<system.web>
    		<customErrors mode="Off"/>
    		<compilation>
    			<assemblies>
    				<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                </assemblies>
    		</compilation>
    	</system.web>
    </configuration>


     

  • b471code3 b471code3

    Star

    9197 Points

    2576 Posts

    Re: Cannot Get AJAX Control Toolkit's Accordion to Work

    Jan 04, 2010 02:02 PM|b471code3|LINK

    brianelliott

    Hey guys.

    I've practically spent seven or eight hours trying to get the ASP.NET AJAX Accordion to work and it simply will not cooperate.  I have been to every imaginable corner of the web thanks to Bing and Google, read post after post on this forum, and done any other thing I could possibly think of to get this to work, yet I still hit this wall.

    Here's the code I've been using to get this to work:

    <div class=dp-highlighter> <div class=bar> <div class=tools>view plaincopy to clipboardprint?</div></div>
    1. <%@ Page Language="VB" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>   
    2.   
    3.   
    4.   
    5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
    6.   
    7. <script runat="server">   
    8.   
    9. </script>   
    10.   
    11. <html xmlns="http://www.w3.org/1999/xhtml">   
    12. <head runat="server">   
    13.     <title></title>   
    14. </head>   
    15. <body>   
    16.     <form id="form1" runat="server">   
    17.     <div>   
    18.         <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">   
    19.         </cc1:ToolkitScriptManager>   
    20.          <cc1:Accordion ID="AccordionStates" runat="server"    
    21.             ContentCssClass="AccordionContent" FramesPerSecond="40"    
    22.             HeaderCssClass="AccordionHeader" SelectedIndex="0"  
    23.             HeaderSelectedCssClass="AccordionHeaderSelected" FadeTransitions="true" RequireOpenedPane="false">   
    24.             <Panes runat="server">   
    25.                 <cc1:AccordionPane ID="Pane_AK" runat="server">   
    26.                     <Header>Arkansas Header</Header>   
    27.                     <Content>Arkansas Content<br />will go<br />here</Content>   
    28.                 </cc1:AccordionPane>   
    29.                 <cc1:AccordionPane ID="Pane_MA" runat="server">   
    30.                     <Header>Massachusetts Header</Header>   
    31.                     <Content>Massachusetts Content<br />will go<br />here</Content>   
    32.                 </cc1:AccordionPane>                       
    33.             </Panes>   
    34.         </cc1:Accordion>   
    35.     </div>   
    36.     </form>   
    37. </body>   
    38. </html>  
    </div>
    <%@ Page Language="VB" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
    
    
    
    
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    
    <script runat="server">
    
    
    </script>
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
            </cc1:ToolkitScriptManager>
             <cc1:Accordion ID="AccordionStates" runat="server"
                ContentCssClass="AccordionContent" FramesPerSecond="40"
                HeaderCssClass="AccordionHeader" SelectedIndex="0"
                HeaderSelectedCssClass="AccordionHeaderSelected" FadeTransitions="true" RequireOpenedPane="false">
                <Panes runat="server">
                    <cc1:AccordionPane ID="Pane_AK" runat="server">
                        <Header>Arkansas Header</Header>
                        <Content>Arkansas Content<br />will go<br />here</Content>
                    </cc1:AccordionPane>
                    <cc1:AccordionPane ID="Pane_MA" runat="server">
                        <Header>Massachusetts Header</Header>
                        <Content>Massachusetts Content<br />will go<br />here</Content>
                    </cc1:AccordionPane>
                </Panes>
            </cc1:Accordion>
        </div>
        </form>
    </body>
    </html>


    As for the Massachusetts/Arkansas bit, I found that on some other forum that said that coding would work (it didn't for me).  I'm hosting this failed attempt at http://pudgle.com/test/development/index/Default.aspx.  I do have the Bin folder in the project, so that's not the issue.

     

    Got your example to work with this change, your server tag for the ScriptManager should be:

    <asp:ScriptManager> and not <cc1:ScriptManager>

    Kentico MVP  Remember to mark as answer.
    View LinkedIn Profile
  • brianelliott brianelliott

    None

    0 Points

    10 Posts

    Re: Cannot Get AJAX Control Toolkit's Accordion to Work

    Jan 04, 2010 02:08 PM|brianelliott|LINK

    By doing that, I receive this:

    Parser Error

    Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

    Parser Error Message: Unknown server tag 'asp:ScriptManager'.

    Source Error:

    Line 16:     <form id="form1" runat="server">
    Line 17:     <div>
    Line 18:         <asp:ScriptManager ID="ScriptManager1" runat="server">
    Line 19:         </asp:ScriptManager>
    Line 20:                 <cc1:Accordion ID="AccordionStates" runat="server" 

    Source File: /test/development/index/default.aspx    Line: 18

     

    I think I need to do what UstesG suggested (with this, too), but I don't know how to go about adding that line of code to my web.config file. 

  • UstesG UstesG

    Participant

    1470 Points

    554 Posts

    Re: Cannot Get AJAX Control Toolkit's Accordion to Work

    Jan 04, 2010 02:11 PM|UstesG|LINK

    in the section <system.web> under pages add a section named <controls>

     

    here is what I have in mine:

    <controls>
    <add namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
    				<add namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
    				<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
    				<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    				<add namespace="Microsoft.Reporting.WebForms" assembly="Microsoft.ReportViewer.WebForms" tagPrefix="rsweb"/>
    				<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></controls>


     

    Please Mark as Answer if You Find Useful!
    But don't expect me to do your job!
  • b471code3 b471code3

    Star

    9197 Points

    2576 Posts

    Re: Cannot Get AJAX Control Toolkit's Accordion to Work

    Jan 04, 2010 02:20 PM|b471code3|LINK

    brianelliott

    I think I need to do what UstesG suggested (with this, too), but I don't know how to go about adding that line of code to my web.config file. 

     

    Before you do anymore trial and error, I think you need to specify a few items:

    1. Version of Visual Studio you are using
    2. Version of the AjaxToolKit you are using
    3. Is the AjaxToolKit installed properly on your machine
    4. Are you properly referencing the AjaxToolkit.dll file properly (relates to #3)

    If you can answer those questions I can get you going in the right direction.  Sounds like you may not have a few references setup properly.  The first time you add an AJAX item to your page it will add the line in the web.config file for you.  But if it's not properly setup then it won't add it, ever, you will have to do it manually.

    Kentico MVP  Remember to mark as answer.
    View LinkedIn Profile
  • brianelliott brianelliott

    None

    0 Points

    10 Posts

    Re: Cannot Get AJAX Control Toolkit's Accordion to Work

    Jan 04, 2010 02:35 PM|brianelliott|LINK

    1. Visual Web Developer 2010 Express Edition Beta 2 (If this is the problem, I have access to Visual Studio 2008 starting tomorrow); I also have Visual Web Developer 2008 Express Edition on my computer if the beta is the issue.

    2. I'm using the latest beta offered from the CodePlex website.

    3. Yes, it is properly installed and is hooked up in the Visual Web Developer 2010 Toolbox.

    4. This file is found in the Bin folder of my project (along with other files/directories it added).  As noticable above, I have this reference at the very top of my page:

    <%

    @ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

    This is everything I have done for the AjaxControlToolkit.

  • brianelliott brianelliott

    None

    0 Points

    10 Posts

    Re: Cannot Get AJAX Control Toolkit's Accordion to Work

    Jan 04, 2010 02:55 PM|brianelliott|LINK

    I placed that in my web.config file in system.web.pages.controls and changed all my tags from cc1 to ajaxToolkit (just to make it less complicated).  I tried adding styles to see if that would make a difference (since every demonstration had them).  Here's what my new code looks like for the entire page, so we're all on the same page.

    <%@ Page Language="VB" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxtookit" %>
    
    
    
    
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    
    <script runat="server">
    
    
    </script>
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <style type="text/css">
            .AccordionHeader
                {
                    display:block;
                    color:#FFFFFF;
                    background:#000077;
                    font-size:16pt;
                }
            .AccordionHeaderSelected
                {
                    display:block;
                    color:#FFFFFF;
                    background:#FF6600;
                    font-size:18pt;
                    font-weight:900;
                }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <ajaxtoolkit:Accordion ID="AccordionStates" runat="server"
                ContentCssClass="AccordionContent" FramesPerSecond="40"
                HeaderCssClass="AccordionHeader" SelectedIndex="0"
                HeaderSelectedCssClass="AccordionHeaderSelected" FadeTransitions="true" RequireOpenedPane="false">
                <Panes>
                    <ajaxtoolkit:AccordionPane ID="Pane_AK" runat="server">
                        <Header>Arkansas Header</Header>
                        <Content>Arkansas Content<br />will go<br />here</Content>
                    </ajaxtoolkit:AccordionPane>
                    <ajaxtoolkit:AccordionPane ID="Pane_MA" runat="server">
                        <Header>Massachusetts Header</Header>
                        <Content>Massachusetts Content<br />will go<br />here</Content>
                    </ajaxtoolkit:AccordionPane>
                </Panes>
            </ajaxtoolkit:Accordion>
        </div>
        </form>
    </body>
    </html>


     

  • Gremln1708 Gremln1708

    None

    0 Points

    15 Posts

    Re: Cannot Get AJAX Control Toolkit's Accordion to Work

    Jan 06, 2010 01:23 AM|Gremln1708|LINK

    Hi...

    I would suggest you try this project in VS2008. Like I said I tested it in VS2008 and it worked 100%.
    Also what i have found is that AJAX Tookit is not supported in VS2010 YET.

    This is one of the links that i have found that confirms that.
    http://forums.asp.net/t/1508847.aspx

  • b471code3 b471code3

    Star

    9197 Points

    2576 Posts

    Re: Cannot Get AJAX Control Toolkit's Accordion to Work

    Jan 06, 2010 07:55 AM|b471code3|LINK

    gremln1708

    Also what i have found is that AJAX Tookit is not supported in VS2010 YET.

     

    All the more reason to not use a BETA product in an production environment!

    Kentico MVP  Remember to mark as answer.
    View LinkedIn Profile
  • DvlsAdvc8 DvlsAdvc8

    Member

    7 Points

    78 Posts

    Re: Cannot Get AJAX Control Toolkit's Accordion to Work

    Mar 08, 2010 12:58 PM|DvlsAdvc8|LINK

    Just manually add "<add tagPrefix="ajax" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"/>" to web.config as someone suggested.  I be this fixes your problem.

    The first 90% of the code is 90% of the development time. The remaining 10% of the code is the other 90% of the development time.
  • shreeharshas shreeharshas

    None

    0 Points

    1 Post

    Re: Cannot Get AJAX Control Toolkit's Accordion to Work

    Dec 05, 2013 05:32 AM|shreeharshas|LINK

    Why are you using Panels?

    Use this instead:

    <asp:Accordion ID="Accordion1" runat="server"
    TransitionDuration="100"
    FramesPerSecond="200"
    FadeTransitions="true"
    RequireOpenedPane="false"
    OnItemDataBound="Accordion1_ItemDataBound"
    ContentCssClass="acc-content"
    HeaderCssClass="acc-header"
    HeaderSelectedCssClass="acc-selected">
    <HeaderTemplate>
    <%#DataBinder.Eval(Container.DataItem, "Name")%>
    </HeaderTemplate>
    <ContentTemplate>
    <%#DataBinder.Eval(Container.DataItem, "Description")%>
    </ContentTemplate>
    </asp:Accordion>

     

    ajax as.net 3.5 Accodion ajax control accordion HeaderTemplatevsHeader

  • ‹ Previous Thread|Next Thread ›