Hello All.

I have a Website built on .NET with the following specificatoin:

  • dot net framework 2.0.

  • windows server 2003.

  • IIS6 .

  • Used Role Provider and sitemap to generate my main menu for each user Role .

  • Used web.config files in each subfolder to secure access to pages acording to users roles.

Every thing was working fine ,until I Upgraded from framework 2.0 to framework 4.0 , i faced two problems that appears sometimes :

1 - security trimming does not work, such that all sitemap nodes are apears for all users regradless the node in their role or not.

2- when user A request information he gots information requested by User B.

Notes:

  • after restart IIS (some time the server machin) every thing works fine.

  • I notced that this problem ocurres when there is alot of requests come to the server .

  • the same site ( Code ) works fine localy ( in VS2010 ) .

have anybody have such situation and can help ?

thanks in advance .

shadi

Member Avatar for LastMitch

1 - security trimming does not work, such that all sitemap nodes are apears for all users regradless the node in their role or not.

You can find the answer here:

http://msdn.microsoft.com/en-us/library/ms178428%28v=vs.100%29.aspx

I copy and paste this message from the link:

To enable security trimming, you need to configure a siteMap Element (ASP.NET Settings Schema) element in your Web.config file. If your site map uses the default ASP.NET site-map provider, then the Web.config file might not contain a siteMap Element (ASP.NET Settings Schema) element, in which case you will need to add one. The following code example adds the default site-map provider and enables security trimming.

This is the code:

<system.web>
<!-- …other configuration settings -->
  <siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
    <providers>
      <add name="XmlSiteMapProvider"
        description="Default SiteMap provider."
        type="System.Web.XmlSiteMapProvider "
        siteMapFile="Web.sitemap"
        securityTrimmingEnabled="true" />
    </providers>
  </siteMap>
</system.web>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.