title: sitemap trimming is not working
body: <p>I have read up on articles and done a lot of research but this is kicking my butt and it should be easy. I'm hoping its easy to fix.</p>
  
  <p>Im trying to trim my sitemap based on roles however the menu control never changes.</p>
  
  <p><strong>Sitemap:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;  
  &lt;siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"&gt;  
      &lt;siteMapNode url="#" title="Home" description="Home"&gt;  
          &lt;siteMapNode url="~/default.aspx" title="Dashboard"  description="" roles="Administrator, Tech, Basic" /&gt;  
          &lt;siteMapNode url="Referrel" title="Referral"  description="" roles="Administrator, Tech, Basic"&gt;  
              &lt;siteMapNode url="referral-new.aspx" title="New"  description="" roles="Administrator, Tech" /&gt;        
              &lt;siteMapNode url="referrals-all.aspx" title="All"  description="" roles="Administrator, Tech, Basic" /&gt;  
          &lt;/siteMapNode&gt;  
          &lt;siteMapNode url="~/reports/default.aspx" title="Reports" description="" roles="CEO" /&gt;  
      &lt;/siteMapNode&gt;  
  &lt;/siteMap&gt;
  </code></pre>
  
  <p><strong>web.config:</strong></p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"&gt;
        &lt;sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"&gt;
          &lt;section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/&gt;
          &lt;sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"&gt;
            &lt;section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/&gt;
            &lt;section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/&gt;
            &lt;section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/&gt;
            &lt;section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/&gt;
          &lt;/sectionGroup&gt;
        &lt;/sectionGroup&gt;
      &lt;/sectionGroup&gt;
  
    &lt;/configSections&gt;
  
    &lt;appSettings&gt;
  
      &lt;add key="ChartImageHandler" value="storage=file;timeout=20;url=~/temp"/&gt;
    &lt;/appSettings&gt;
    &lt;connectionStrings&gt;
      &lt;add name="ConnectionString" connectionString="Server=localhost;Database=;User ID=;Password=;" providerName="System.Data.SqlClient"/&gt;
    &lt;/connectionStrings&gt;
    &lt;system.web&gt;
      &lt;!--
  Set compilation debug="true" to insert debugging
  symbols into the compiled page. Because this
  affects performance, set this value to true only
  during development.
  --&gt;
      &lt;httpRuntime executionTimeout="90" maxRequestLength="20000" useFullyQualifiedRedirectUrl="false" requestLengthDiskThreshold="8192"/&gt;
      &lt;customErrors mode="Off"/&gt;
      &lt;compilation debug="true"&gt;
        &lt;assemblies&gt;
          &lt;add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;
          &lt;add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;
          &lt;add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
          &lt;add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;
          &lt;add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/&gt;
          &lt;add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
          &lt;add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
          &lt;add assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
          &lt;add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;
        &lt;/assemblies&gt;
      &lt;/compilation&gt;
      &lt;authentication mode="Forms"&gt;
        &lt;forms loginUrl="Login.aspx" timeout="20" name="eReferral" requireSSL="false" defaultUrl="default.aspx"/&gt;
      &lt;/authentication&gt;
      &lt;authorization&gt;
        &lt;deny users = "?"/&gt;
      &lt;/authorization&gt;
      &lt;membership&gt;
        &lt;providers&gt;
          &lt;clear/&gt;
          &lt;add name="AspNetSqlMembershipProvider" connectionStringName="ConnectionString" applicationName="/" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/&gt;
        &lt;/providers&gt;
      &lt;/membership&gt;
      &lt;roleManager enabled="true"&gt;
        &lt;providers&gt;
          &lt;clear/&gt;
          &lt;add name="AspNetSqlRoleProvider" connectionStringName="ConnectionString" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/&gt;
        &lt;/providers&gt;
      &lt;/roleManager&gt;
      &lt;siteMap defaultProvider="XmlSiteMapProvider" enabled="true"&gt;
        &lt;providers&gt;
          &lt;add name="XmlSiteMapProvider" description="Default SiteMap provider." type="System.Web.XmlSiteMapProvider" siteMapFile="web.sitemap" securityTrimmingEnabled="true"/&gt;
        &lt;/providers&gt;
      &lt;/siteMap&gt;
  
      &lt;!--
  The &lt;customErrors&gt; section enables configuration
  of what to do if/when an unhandled error occurs
  during the execution of a request. Specifically,
  it enables developers to configure html error pages
  to be displayed in place of a error stack trace.
  
  &lt;customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"&gt;
  &lt;error statusCode="403" redirect="NoAccess.htm" /&gt;
  &lt;error statusCode="404" redirect="FileNotFound.htm" /&gt;
  &lt;/customErrors&gt;
  --&gt;
      &lt;pages theme="Clean"&gt;
        &lt;controls&gt;
          &lt;add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
          &lt;add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
          &lt;add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/&gt;
        &lt;/controls&gt;
      &lt;/pages&gt;
      &lt;httpHandlers&gt;
        &lt;remove path="*.asmx" verb="*"/&gt;
        &lt;add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/&gt;
        &lt;add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/&gt;
        &lt;add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/&gt;
        &lt;add path="BarcodeGen.axd" verb="*" type="Neodynamic.WebControls.BarcodeProfessional.BarcodeProfessional, Neodynamic.WebControls.BarcodeProfessional"/&gt;
        &lt;add path="ChartImg.axd" verb="GET,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/&gt;
      &lt;/httpHandlers&gt;
      &lt;httpModules&gt;
        &lt;add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
      &lt;/httpModules&gt;
    &lt;/system.web&gt;
  
    &lt;!-- This section gives the unauthenticated user access --&gt;
  
    &lt;location path="forgot-password.aspx"&gt;
      &lt;system.web&gt;
        &lt;authorization&gt;
          &lt;allow users="*"/&gt;
        &lt;/authorization&gt;
      &lt;/system.web&gt;
    &lt;/location&gt;
  
  
    &lt;!-- Referral Folder --&gt;
    &lt;location path="referral/referral-new.aspx"&gt;
      &lt;system.web&gt;
        &lt;authorization&gt;
          &lt;allow roles="Tech"/&gt;
          &lt;deny users="?" /&gt;
        &lt;/authorization&gt;
      &lt;/system.web&gt;
    &lt;/location&gt;
    &lt;location path="referral/referral-details.aspx"&gt;
      &lt;system.web&gt;
        &lt;authorization&gt;
          &lt;allow roles="Administrator, Basic, Tech, Physician"/&gt;
          &lt;deny users="?" /&gt;
        &lt;/authorization&gt;
      &lt;/system.web&gt;
    &lt;/location&gt;
    &lt;location path="referral/referral-new.aspx"&gt;
      &lt;system.web&gt;
        &lt;authorization&gt;
          &lt;allow roles="Administrator, Basic, Tech, Physician"/&gt;
          &lt;deny users="?" /&gt;
        &lt;/authorization&gt;
      &lt;/system.web&gt;
    &lt;/location&gt;
  
    &lt;location path="Reports/default.aspx"&gt;
      &lt;system.web&gt;
        &lt;authorization&gt;
          &lt;allow roles="CEO"/&gt;
          &lt;deny users="?" /&gt;
        &lt;/authorization&gt;
      &lt;/system.web&gt;
    &lt;/location&gt;
  
  
    &lt;system.codedom&gt;
      &lt;compilers&gt;
        &lt;compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"&gt;
          &lt;providerOption name="CompilerVersion" value="v3.5"/&gt;
          &lt;providerOption name="WarnAsError" value="false"/&gt;
        &lt;/compiler&gt;
      &lt;/compilers&gt;
    &lt;/system.codedom&gt;
    &lt;!--
  The system.webServer section is required for running ASP.NET AJAX under Internet
  Information Services 7.0. It is not necessary for previous version of IIS.
  --&gt;
    &lt;system.webServer&gt;
      &lt;validation validateIntegratedModeConfiguration="false"/&gt;
      &lt;modules&gt;
        &lt;remove name="ScriptModule"/&gt;
        &lt;add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
      &lt;/modules&gt;
      &lt;handlers&gt;
        &lt;remove name="WebServiceHandlerFactory-Integrated"/&gt;
        &lt;remove name="ScriptHandlerFactory"/&gt;
        &lt;remove name="ScriptHandlerFactoryAppServices"/&gt;
        &lt;remove name="ScriptResource"/&gt;
        &lt;remove name="ChartImageHandler"/&gt;
        &lt;add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
        &lt;add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
        &lt;add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
        &lt;add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/&gt;
        &lt;add name="BarcodeGen" path="BarcodeGen.axd" verb="*" type="Neodynamic.WebControls.BarcodeProfessional.BarcodeProfessional, Neodynamic.WebControls.BarcodeProfessional"/&gt;
      &lt;/handlers&gt;
    &lt;/system.webServer&gt;
    &lt;runtime&gt;
      &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/&gt;
          &lt;bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/&gt;
          &lt;bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/&gt;
        &lt;/dependentAssembly&gt;
      &lt;/assemblyBinding&gt;
    &lt;/runtime&gt;
    &lt;system.net&gt;
      &lt;settings&gt;
        &lt;httpWebRequest useUnsafeHeaderParsing="true"/&gt;
      &lt;/settings&gt;
    &lt;/system.net&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>What could be the problem?</p>