This is in response to the comment above. I can't post the full code, but this is basically how my provider works.
Suppose you have a page article.aspx, and it uses query string parameter "id" to retrieve and display an article title and body. Then this is in Web.sitemap:
<siteMapNode url="/article.aspx" title="(this will be replaced)" param="id" />
Then, you create this class:
public class DynamicSiteMapPath : SiteMapPath
{
protected override void InitializeItem(SiteMapNodeItem item)
{
if (item.ItemType != SiteMapNodeItemType.PathSeparator)
{
string url = item.SiteMapNode.Url;
string param = item.SiteMapNode["param"];
// get parameter value
int id = System.Web.HttpContext.Current.Request.QueryString[param];
// retrieve article from database using id
<write your own code>
// override node link
HyperLink link = new HyperLink();
link.NavigateUrl = url + "?" + param + "=" + id.ToString();
link.Text = <the article title from the database>;
link.ToolTip = <the article title from the database>;
item.Controls.Add(link);
}
else
{
// if current node is a separator, initialize as usual
base.InitializeItem(item);
}
}
}
Finally, you use this provider in your code just like you would use the static provider.
<mycontrols:DynamicSiteMapPath ID="dsmpMain" runat="server" />
My class is more complicated than this, but these are the basics. Instead of using a querystring parameter, you could just analyze the friendly url you're using, and use that instead to retrieve the correct content. To minimize the additional db lookups with every request, you can add a caching mechanism to the provider (article title usually won't change often).
Hope this helps.