Aidan Garnish

Collaboration Not Competition

Solution to the ampersand (&) gotcha in SiteMapPath breadcrumb

If you name a site or page with an & and you want to also use the breadcrumb SiteMapPath control then you are going to see some nasty results. This is because the control outputs "&" instead of "&".

To fix this you need to make a change to the sitemappath control. Simply include SiteMapProvider="CurrentNavSiteMapProviderNoEncode" as follows:

 <asp:SiteMapPath runat="server" id="SiteMapPath1" PathSeparator="|" SiteMapProvider="CurrentNavSiteMapProviderNoEncode"></asp:SiteMapPath>

Add comment

Loading