Help with sitemap trimming

Discussion in 'ASP.NET / ASP.NET Core' started by addis, Sep 1, 2008.

  1. Hello every one. I am building a website and encountered a problem with a sitemap. I wanted to enable sitemapTrimming to my site how ever this feature is not working properly unless all the child nodes are in one group. I wanted to use the format below every time I fire up the site the whole navigation links disappear. I need help to resolve this problem please help me.
    I checked this sites for help. http://weblogs.asp.net/scottgu/archive/2005/11/20/431019.aspx ; http://weblogs.asp.net/scottgu/archive/2006/02/14/438241.aspx ; http://aspnet.4guysfromrolla.com/articles/111605-1.aspx I did not get what I wanted. Please help I have attached the site map and the web.config file for reference.

    ---------------------------------------------------------------------------------------
    <siteMap defaultProvider='XmlSiteMapProvider' enabled='true'>
    <providers>
    <add name='XmlSiteMapProvider'
    description='Default SiteMap provider.'
    type='System.Web.XmlSiteMapProvider '
    siteMapFile='Web.sitemap'
    securityTrimmingEnabled='true' />
    </providers>
    </siteMap>

    ------------------------------------------------------------------------------------


    <siteMap xmlns='http://schemas.microsoft.com/AspNet/SiteMap-File-1.0' >
    <siteMapNode >
    <siteMapNode url='' roles='*' title='All'>
    <siteMapNode url='~/Default.aspx' roles='*' title='Home'/>
    <siteMapNode url='~/Pages/Default.aspx' roles='*' title='2nd Page' />
    <siteMapNode url='~/Pages/Login.aspx' roles='*' title='Login' />
    <siteMapNode url='~/Pages/Forum.aspx' roles='*' title='Forum' />
    <siteMapNode url='~/Pages/Contact Us.aspx' roles='*' title='Contact' />
    </siteMapNode>
    <siteMapNode url='' title='Accounts'>
    <siteMapNode url='~/Accounts/Default.aspx' title='Accounts' />
    <siteMapNode url='~/Accounts/User1/Default.aspx' title='User1' />
    <siteMapNode url='~/Accounts/User2/Default.aspx' title='User2' />
    <siteMapNode url='~/Accounts/User3/Default.aspx' title='User3' />
    </siteMapNode>
    <siteMapNode url='' title='Secure'>
    <siteMapNode url='~/Secure/Default.aspx' title='Upload' />
    <siteMapNode url='~/Secure/Downloads.aspx' title='Downloade' />
    <siteMapNode url='~/Secure/Reference.aspx' title='Reference' />
    </siteMapNode>
    </siteMapNode>
    </siteMap> </font> </font>
     

Share This Page