沒有securityTrimmingEnabled,菜單顯示了罰款,但只要我打開它,整個菜單消失。就像,我正在談論的一切,即使是默認頁面和那些不需要授權的頁面。網站地圖授權化妝菜單消失
這裏是Web.sitemap中的代碼
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
<siteMapNode>
<siteMapNode title="Home" url="~/Default.aspx" />
<siteMapNode title="About" url="~/About.aspx" />
<siteMapNode title="Suppliers" url="~/Suppliers.aspx" />
<siteMapNode title="Departments" url="~/Departments.aspx" />
<siteMapNode title="Management">
<siteMapNode title="Account" url="~/Account_Employee.aspx" />
<siteMapNode title="Store" url="~/StoreManagement.aspx" />
<siteMapNode title="Chain" url="~/ChainManagement.aspx" />
<siteMapNode title="System" url="~/SystemAdmin.aspx" />
</siteMapNode>
</siteMapNode>
</siteMap>
下面是在web.config中
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
</authentication>
<membership defaultProvider="TestServerMembership">
<providers>
<clear/>
<add name="TestServerMembership" type="System.Web.Security.SqlMembershipProvider" connectionStringName="TestServerConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresUniqueEmail="false" requiresQuestionAndAnswer="false" minRequiredPasswordLength="5" minRequiredNonalphanumericCharacters="0" applicationName="SampleSite" passwordFormat="Hashed"/>
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="TestServerMembershipProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="TestServer" applicationName="/"/>
</providers>
</profile>
<roleManager enabled="true" defaultProvider="TestServerRoleProvider">
<providers>
<clear/>
<add connectionStringName="TestServerConnection" applicationName="/" name="TestServerRoleProvider" type="System.Web.Security.SqlRoleProvider"/>
</providers>
</roleManager>
<siteMap enabled="true">
<providers>
<clear/>
<add siteMapFile="Web.sitemap" name="AspNetXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider" securityTrimmingEnabled="true"/>
</providers>
</siteMap>
這裏網站授權設置的代碼是在web.config中
爲角色設置代碼<location path="Default.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="About.aspx">
<system.web>
<authorization>
<deny users="*"/>
<allow roles="User"/>
</authorization>
</system.web>
</location>
<location path="Departments.aspx">
<system.web>
<authorization>
<deny users="*"/>
<allow roles="User"/>
</authorization>
</system.web>
</location>
<location path="Suppliers.aspx">
<system.web>
<authorization>
<deny users="*"/>
<allow roles="User"/>
</authorization>
</system.web>
</location>
<location path="Account_Employee.aspx">
<system.web>
<authorization>
<deny users="*"/>
<allow roles="User"/>
</authorization>
</system.web>
</location>
<location path="StoreManagement.aspx">
<system.web>
<authorization>
<deny users="*"/>
<allow roles="StoreManager"/>
</authorization>
</system.web>
</location>
<location path="ChainManagement.aspx">
<system.web>
<authorization>
<deny users="*"/>
<allow roles="ChainManager"/>
</authorization>
</system.web>
</location>
<location path="SystemAdmin.aspx">
<system.web>
<authorization>
<deny users="*"/>
<allow roles="XsiteInternalAdmin"/>
</authorization>
</system.web>
</location>
您的身份驗證無法訪問您的站點地圖,必須將其從身份驗證中解放出來。你使用CSS或您的網站地圖是在根目錄? – jams
Sitemap位於根目錄下。我試着用你的snippit,它沒有改變任何東西。 – Bill
現在是工作或沒有? – jams