I see you have already accepted an answer, but I thought some code would help, so here is some:
Site1.Master
<asp:SiteMapPath ID="SiteMapPath1" Runat="server" OnItemDataBound="Item_Bound">
<PathSeparatorTemplate>
<asp:Image ID="SepImage" runat="server" ImageUrl="/images"/>
</PathSeparatorTemplate>
</asp:SiteMapPath>
Site1.Master.cs
private string lastItemKey = "";
public void Item_Bound(Object sender, SiteMapNodeItemEventArgs e)
{
if (e.Item.ItemType == SiteMapNodeItemType.PathSeparator)
{
string imageUrl = ((Image) e.Item.Controls[1]).ImageUrl;
imageUrl += lastItemKey + ".png";
((Image) e.Item.Controls[1]).ImageUrl = imageUrl;
}
else
{
lastItemKey = e.Item.SiteMapNode.Key;
}
}
Then I have an /images
directory containing an image for each of the Key
's of the SiteMapNode
s. In other terms: this code will result in the image being displayed, after each of the path nodes, to depend on the key of the node before it.
Hope this helps someone.