Created
March 21, 2011 15:23
-
-
Save thinkt4nk/879616 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
Action<System.Data.DataTable, int> printCategoriesRecursively = null; | |
printCategoriesRecursively = (System.Data.DataTable categoryRows, int depth) => { | |
if (categoryRows==null || categoryRows.Rows.Count==0) return; | |
%> | |
<ul class="node-list depth-<%=depth%>"> | |
<% | |
foreach (System.Data.DataRow CategoryRow in categoryRows.Rows) { | |
%> | |
<li> | |
<%=CategoryRow["categoryCode"]%> | |
<% BAL.Category Category = new BAL.Category((String)CategoryRow["categoryCode"]); %> | |
<%printCategoriesRecursively(Category.getChildren(), depth + 1);%> | |
</li> | |
<% | |
} | |
%> | |
</ul> | |
<% | |
}; | |
printCategoriesRecursively(TopLevelCategories, 0); | |
%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment