I’m extremely unfamiliar with both .NET and VB.NET and can’t quite figure out how to do this. Say I have code like this:
<div class="breadcrumb">
<asp:SiteMapPath ID="SiteMapPath1" runat="server"></asp:SiteMapPath>
</div>
It outputs a bunch of <span>s with > as separators, something like this:
<div class="breadcrumb">
<span id="ctl00_SiteMapPath1">
<a href="#ctl00_SiteMapPath1_SkipLink">
<img alt="Skip Navigation Links" height="0" width="0" src="/Bonfield/WebResource.axd?d=PEpmmIw6qvhaEC3hEwXGjgvJKlzc3DOMu_e-zW-n6pfl6YR-iYjwmlvrYPb689EslKxysA7aoh_x_ALjLs5QXiz7NG41&t=634245478914809245" style="border-width:0px;" />
</a>
<span>
<a href="/Bonfield/Default.aspx">Home</a>
</span>
<span> » </span>
<span>Showcase</span><a id="ctl00_SiteMapPath1_SkipLink"></a></span>
</div>
How can I turn that into a list like:
<ul>
<li>Home</li>
<li>Showcase</li>
</ul>
You may have solved this by now but you could use this function to loop through all the items in the rootnode of a sitemap and their descendants and build up a nested list.
You can remove
If item.HasChildNodes Then sb.Append(ListChildNodes(item))if you are only interested in the top levelFor those who would like the C# version:
Then in your code you can just call to output the string to the page.