Add/remove site map node using MvcSiteMapProvider

add new CustomSiteMapProvider

public class CustomSiteMapProvider : DefaultSiteMapProvider
{
public void ClearSiteMap()
{
Clear();
}
}

Change web.config file to use the custom sitemapprovider instead of DefaultSiteMapProvider.
When node changes, add

((CustomSiteMapProvider)SiteMap.Provider).ClearSiteMap();

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注