OK It seems not the best way but here how I solved this... Hope it helps others :)
protected void Page_Load(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); using (ProjectsDataContext dc = new ProjectsDataContext()) { var categories = from cats in dc.Categories select cats; sb.Append("<ul id=\"sitemap\" class=\"sitemap\">"); foreach (Category c in categories) { sb.Append("<li><a href=\"ShowCategory.aspx?CategoryID="+c.CategoryID +"\">"+ c.Name+"</a>"); var subcategories = from subs in dc.SubCategories where (subs.Category.Name == c.Name) select subs; sb.Append("<ul>"); foreach (SubCategory s in subcategories) { sb.Append("<li><a href=\"../ShowSubCategory.aspx?SubCategoryID=" + s.SubCategoryID + "\">" + s.Name + "</a></li>"); } sb.Append("</ul></li>"); } sb.Append("</ul>"); } lala.Text = sb.ToString(); }