I implemented a SiteMap that was extended from SQLSiteMapProvider in Jeff Prosise's MSDN article. Jeff Prosise used SQLServer Notification as a mechanism as to refresh the SiteMap. After I changed the stored procedure to use the Common Table Expression, I found that I freqently receive unwanted notification that cleared my sitemap. Since the SiteMap table is managed by a content management system, I decided to implement an alternative way to refresh the sitemap.
The way is to change the SQLSiteMapProvider to implement an IRefreshable interface:
public interface IRefreshable
{
void Refresh();
}
In my CMS code, I then call the Refresh method to refresh the sitemap:
IRefreshable siteMapProvider = SiteMap.Provider as IRefreshable;
if (siteMapProvider != null)
{
siteMapProvider.Refresh();
}