This project is read-only.

Problem w/ XmlSiteMapProvider

May 22, 2008 at 12:39 AM
Edited May 22, 2008 at 12:40 AM
Hey everyone,

I am trying to incorporate the blog into an existing application.  So, I'm using the built-in .Net Membership and Roles providers for logging my users in.  My users are able to login fine, but the "roles" attribute of the web.sitemap and the "IsAccessibleToUser" in the menu.ascx.cs is no longer functioning.

No matter what role(s) I set each node, ALL nodes are still displaying.  If I call Roles.GetRolesForUser(Membership.GetUser()), then the correct role(s) for the current logged in user are displayed.  But, that really doesn't matter because, again, no matter what role(s) I put in the web.sitemap, all nodes are still shown.

Here's what I've got...

My login code-behind:

    if (Membership.ValidateUser(username.Text, password.Text))
        FormsAuthentication.RedirectFromLoginPage(username.Text, true);
        ErrorLbl.Visible = true;


    <siteMap defaultProvider="SecuritySiteMap" enabled="true">
            <add name="SecuritySiteMap" type="System.Web.XmlSiteMapProvider" securityTrimmingEnabled="true" siteMapFile="Web.sitemap" />

Everything else is the same as the blog app.