Question

I have an application with security configuration and roles are created for the same application.i want to set visibility of the menu item on role basis.I have used following code to achieve this In Web.sitemap

<siteMapNode url="" title=""  description="" >
    <siteMapNode url="~/Account/Default.aspx" title="Change Password"  description=""  securityTrimmingEnabled="true"/>
    <siteMapNode url="~/Account/ChangePasswordSuccess.aspx" title="Welcome"  description="" />
    <siteMapNode url="~/Account/Demo.aspx" title="Demo"  description="" />
</siteMapNode>

In web.config

 <system.web>
<siteMap enabled="true" defaultProvider ="AspNetXmlSiteMapProvider" >
        <providers>
            <clear/>
            <add siteMapFile="Web.sitemap" name="AspNetXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider" securityTrimmingEnabled="true" />
        </providers>
    </siteMap>
        </system.web>

while running the application and login into website i got error like *Unrecognized attribute 'securityTrimmingEnabled'. Note that attribute names are case-sensitive. * This error again repeating even i remove it from web.config.Can you look over this and tell me where i went wrong.

Was it helpful?

Solution 2

Its done simply by removing securityTrimmingEnabled="true in the sitemap file.

OTHER TIPS

You don't need the securityTrimmingEnabled="true" in the sitemap file, only in the web.config where your sitemap provider is added.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top