I'm trying to generate Accordion Pane from code behind. Somehow, the accordion is not display out. I have a Menu.aspx which is in the AccordionMenu ContentPlaceHolder and also a div. In my code behind, i try to create accordion pane with the div. Below are my codes.
Menu.aspx
<asp:Content ID="Content1" ContentPlaceHolderID="AccordionMenu" runat="Server">
<div id="divMenu" style="width: 241px" runat="server"></div>
CODE BEHIND
protected void Page_Load(object sender, EventArgs e)
{
// Create Accordion Pane Header Content
divMenu.InnerHtml = "<div class='tab_container' id='tab_container'>";
foreach (SiteMapNode node in SiteMap.RootNode.ChildNodes)
{
// Header
//Check whether is first node
if (SiteMap.RootNode.ChildNodes.Count == 0)
{
// Create header html
divMenu.InnerHtml += "<h3 class='d_active tab_drawer_heading' rel='" + node.Title + "'>" + node.Title + "</h3>";
}
else
{
divMenu.InnerHtml += "<h3 class='tab_drawer_heading' rel='" + node.Title + "'>" + node.Title + "</h3>";
}
// Create header html
divMenu.InnerHtml += "div id='" + node.Title + "' class='tab_content' style='display: block;'>";
// Content
foreach (SiteMapNode child in node.ChildNodes)
{
// Check Role Access Right
if (CheckRolePermission(ConstantValues.MAINTENANCEMODE_VIEW, GetFunctionNameByTitle(child.Title)))
{
// Create content html
divMenu.InnerHtml += "<p>" + child.Title + "</p>";
divMenu.InnerHtml += "</div>";
}
}
}
divMenu.InnerHtml += "</div>";
}
HTML ONLY - Working
<table border="0" cellspacing="0" cellpadding="0" id="content-container">
<tr>
<td>
<div class="tab_container" id="tab_container">
<h3 class="d_active tab_drawer_heading" rel="tab1">Tab 1</h3>
<div id="tab1" class="tab_content" style="display: block;">
<p>Content 1</p>
</div>
<h3 class="tab_drawer_heading" rel="tab2">Tab 2</h3>
<div id="tab2" class="tab_content" style="display: none;">
<p>Content 2</p>
</div>
<h3 class="tab_drawer_heading" rel="tab3">Tab 3</h3>
<div id="tab3" class="tab_content" style="display: none;">
<p>Content 3</p>
</div>
</div>
<script src="Menu/Js/menu.js" type="text/javascript"></script>
</td>
<td/>
</tr>
</table>
<asp:Repeater />)?<div />at all? Could it be related tocss?