Hi,
I'm creating a blog with the Accordion Control. That means that the content of the accordion control must be dynamic, I want to create the accordionpane controls on the flow but the accordion control can't work placeholders. I'll explain beter with some code
This is the userControl News:
1 <ajaxToolkit:AccordionPane ID="AccordionPane1" runat="server">
2 <Header>
3 <a href="#" class="accordionLink"><%=Name %></a>
4 </Header>
5 <Content>
6 <ul>
7 <li>Name: <%=Name %></li>
8 </ul>
9 </Content>
10 </ajaxToolkit:AccordionPane>
This is news.aspx (here must the accordion be created)
1 <ajaxToolkit: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">
2 <Panes>
3 <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
4 </Panes>
5 </ajaxToolkit:Accordion>
This is a part of the source code of the News.aspx (in this part i generate all the accordionpanes to print)
1 foreach (News b in this.News) {
2 Controls_UC_News x = (Controls_UC_News)LoadControl("~/Controls/UC_News.ascx");
3 x.Name = b.Naam;
4 PlaceHolder1.Controls.Add(x);
5 }
The problem is that Accordion can't work with the PlaceHolder... Is there any other way to fix this problem and to make it possible to repeat things on the accordion?
Thanks in advance!