knoerregaard 0 Newbie Poster

Hello,

I hope that i can explain my self as I have a problem.

I have an Accordion inside of a updatapanel. First Pane in the Accordion has three button. When ever I push the button, somethings gets loaded into a Placeholder in Pane number two.

The problem is that after two or three pushes on the button, the functionality stops working, and nothing gets loaded into the placeholder. When I refresh the page I then can push the button again.
I think it has something to do with postbacks and stuff, but I am not familiar with debugging yet.

<div id="content"> 

    <ajaxToolkit:Accordion ID="MyAccordion" runat="server"
            Width="650px"
            SelectedIndex="0"   
            HeaderCssClass="accordionHeader" 
            HeaderSelectedCssClass="accordionHeader"
            ContentCssClass="accordionContent" 
            FadeTransitions="false" 
            FramesPerSecond="40" 
            TransitionDuration="250" 
            AutoSize="None" 
            RequireOpenedPane="false" 
            SuppressHeaderPostbacks="true">
           <Panes>
            <ajaxToolkit:AccordionPane ID="AccordionPane1" runat="server">
                <Header>1. Vælg først emne du vil anmelde</Header>
                <Content>
                    <asp:UpdatePanel  ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
                    <ContentTemplate>
                    <div style=" height:50px; margin:10px;"><div class="left_text"><h3><strong><asp:Label ID="Label5" runat="server" Text="Vælg hvad du vil anmelde"></asp:Label></strong></h3></div> <div class="right_input"><asp:Image ID="Image4" ImageUrl="~/images/reviewProduct.png"  runat="server" /></div></div>
                    <br /><br />
                    <table style="width:620px;">
                                <tr>
                                    <td class="radioButtons"> <h4>En Butik</h4><br />
                                        <asp:ImageButton ID="ImageButton2" runat="server" OnClick="showProductReview" ImageUrl="~/images/shop.jpg" /></td><br />
                                    <td class="radioButtons"><h4> Et produkt</h4><br />
                                       <asp:ImageButton ID="ImageButton1" runat="server" OnClick="showButikReview" ImageUrl="~/images/shop.jpg" /></td><br />
                                    <td class="radioButtons"><h4> Underholdning</h4><br />
                                        <asp:ImageButton ID="ImageButton3" runat="server"  ImageUrl="~/images/shop.jpg" /></td><br />
                                </tr>
                            </table>
                        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                </ContentTemplate>
                <Triggers>
                <asp:AsyncPostBackTrigger ControlID="ImageButton1" EventName="Click"/>
                <asp:AsyncPostBackTrigger ControlID="ImageButton2" EventName="Click"/>
                </Triggers>
                </asp:UpdatePanel>  
                </Content>
            </ajaxToolkit:AccordionPane>
            <ajaxToolkit:AccordionPane ID="AccordionPane2" runat="server">
                <Header>2. Forbrugeranmeld emnet</Header>
                <Content>
                    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="always">
                    <ContentTemplate>
                            <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
                    </ContentTemplate>
                    </asp:UpdatePanel>
                </Content>
            </ajaxToolkit:AccordionPane>
            <ajaxToolkit:AccordionPane ID="AccordionPane3" runat="server">
                <Header>3. Tilføj billede eller filmklip</Header>
                <Content>
                    Content here.
                </Content>
            </ajaxToolkit:AccordionPane>
            <ajaxToolkit:AccordionPane ID="AccordionPane4" runat="server">
                <Header>4. Godkend forbrugeranmeldelse</Header>
                <Content>
                    Content here.
                </Content>
            </ajaxToolkit:AccordionPane>
            </Panes>
        </ajaxToolkit:Accordion>
protected void Page_Load(object sender, EventArgs e)
        {
          

        }

        public void showButikReview(object sender, EventArgs e)
        {

            
            Label1.Text = "Show Shop";
            Control toAdd = LoadControl("~/userControls/reviewShop.ascx");
            PlaceHolder1.Controls.Add(toAdd);

        }
        public void showProductReview(object sender, EventArgs e)
        {

            
                Label1.Text = "Show Product";
                Control toAdd = LoadControl("~/userControls/reviewProduct.ascx");
                PlaceHolder1.Controls.Add(toAdd);

        }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.