Link to home
Create AccountLog in
Avatar of mlong219
mlong219Flag for United States of America

asked on

ASPToolKit: Accordion Control rendering error message in Design Mode

I'm receiving the following error in DesignMode with the Accordion1 control. Not sure what is causing this. This is my ASP WebApp.

Error Rendering Control - Accordion1
An unhandled exception has occurred. Collection was modified; enumeration operation may not execute.

VS 2005 Pro
ASP Ajax
XP SP3

Thanks.
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="SmartBlnd.aspx.cs" Inherits="SmartBlnd" Title="Smart Blinding Definition" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:Label ID="Label2" runat="server" Text="Project#" Width="69px"></asp:Label>
    <asp:TextBox ID="TxtBoxProject" runat="server" MaxLength="6" ToolTip="Enter Covance Project Number"
        Wrap="False"></asp:TextBox>
    <asp:Button ID="Button2" runat="server" OnClick="Button1_Click" Text="Search" />
    <asp:Button ID="btn_SendEmail" runat="server" Text="Email" Visible="False" OnClick="btn_SendEmail_Click" />
    <asp:Label ID="lbl_CTSmartHeader" runat="server" Text="No Records found  in CT" Visible="False"
        Width="135px"></asp:Label>
    <asp:Label ID="lbl_SmartHeader" runat="server" Text="No records found in Smart" Visible="False"
        Width="69px"></asp:Label>&nbsp;
    <asp:TextBox ID="txt_EmailResults" runat="server" Visible="False"></asp:TextBox>
    <asp1:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server">
    </asp1:ToolkitScriptManager>
    &nbsp;
    <asp1:Accordion ID="Accordion1" runat="server">
        <Panes>
            <asp1:AccordionPane ID="AccordionPane1" runat="server">
                <Header>
                    <a href="" onclick="return false;" class="accordionLink">CT Specimen Classes </a>
                </Header>
                <Content>
                    <asp:GridView ID="GridView1" runat="server" BackColor="White" BorderColor="#CCCCCC"
                        BorderStyle="None" BorderWidth="1px" CellPadding="3">
                        <FooterStyle BackColor="White" ForeColor="#000066" />
                        <RowStyle ForeColor="#000066" />
                        <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                        <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                    </asp:GridView>
                </Content>
            </asp1:AccordionPane>
            <asp1:AccordionPane ID="AccordionPane2" runat="server">
                <Header>
                    <a href="" onclick="return false;" class="accordionLink">lbl_SmartHeader</a>
                </Header>
                <Content>
                    <asp:GridView ID="GridView2" runat="server" BackColor="White" BorderColor="#CCCCCC"
                        BorderStyle="None" BorderWidth="1px" CellPadding="3">
                        <FooterStyle BackColor="White" ForeColor="#000066" />
                        <RowStyle ForeColor="#000066" />
                        <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                        <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                    </asp:GridView>
                </Content>
            </asp1:AccordionPane>
        </Panes>
    </asp1:Accordion>
</asp:Content>

Open in new window

Accordion-Error.jpg
Avatar of Ajay Sharma
Ajay Sharma
Flag of India image

Try adding below peoperties in the Accordion declaration:

FadeTransitions="true" FramesPerSecond="40"   SuppressHeaderPostbacks="false"
ContentCssClass="AccordionContent" HeaderCssClass="AccordionHeader" HeaderSelectedCssClass="AccordionHeaderSelected"

Reference : http://forums.asp.net/t/1391987.aspx
ASKER CERTIFIED SOLUTION
Avatar of mlong219
mlong219
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of mlong219

ASKER

I found the answer in the AjaxToolKit Forum.

http://forums.asp.net/t/1161813.aspx?PageIndex=1
@MLONG219:

Just wanted to say thanks so much for this. I had a bare bones page with nothing but the accordian and had checked and rechecked the AJAX install, framework properties, web.config file etc. and nothing worked until I added SelectedIndex="0".

Thanks again!!!