Hello everyone
I have a little but for me disturbing problem with the new Accordion control. When I use this control as it is, by placing it in the aspx page and by adding the panes myself etc... I can see the Accordion poping up with the first pane open (immediately) --> the same as you can see on the demonstration page of asp.net ajax control toolkit.
My problem is that I have to program the Accordion control because I want to put in the SiteMap information. Below is the code I have used for it (a little less for demonstration purposes). When I open the page (and do postbacks etc) you can always see in my case that the accordion pops up closed (all the panes are closed) and immediately opens up the first pane (after 1 second). This is VERY annoying for me :-)
Does anyone has a solution to let the accordion show the first pane when it has been rendered instead of poping up?
Thx !!!!
Gerrie
my code in the Page_Load of the master page
-------------------------------------------------------------------
userAuthenticated = HttpContext.Current.User.Identity.IsAuthenticated;
for (int i = 0; i < SiteMap.RootNode.ChildNodes.Count; i++)
{
showAlways = false;
SiteMapNode smn = (SiteMapNode)SiteMap.RootNode.ChildNodes[i]; foreach (string strRole in smn.Roles)
{
if (strRole.Contains("*"))
showAlways = true;
} if (showAlways || (!showAlways && userAuthenticated))
{
AccordionPane p = new AccordionPane();
p.ID = "Pane" + i;
p.HeaderContainer.Controls.Add(new LiteralControl("<b>" + SiteMap.RootNode.ChildNodes[i].ToString() + "</b><br>")); if (smn.HasChildNodes)
{
for (int j = 0; j < smn.ChildNodes.Count; j++)
{
p.ContentContainer.Controls.Add(new LiteralControl("<div class='MenuOption'>"));
p.ContentContainer.Controls.Add(new LiteralControl("<a href='"));
p.ContentContainer.Controls.Add(new LiteralControl(smn.ChildNodes[j].Url));
p.ContentContainer.Controls.Add(new LiteralControl("' class='MenuLink'>"));
p.ContentContainer.Controls.Add(new LiteralControl(smn.ChildNodes[j].ToString()));
p.ContentContainer.Controls.Add(new LiteralControl("</a></div>"));
}
}
} myAccordion.Panes.Add(p);
}