启用安全修整后,我的完整菜单系统未显示...
我在Web.config中启用了安全修整,如下所示......
<siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
<providers>
<add name="XmlSiteMapProvider"
description="Default SiteMap provider."
type="System.Web.XmlSiteMapProvider"
siteMapFile="Web.sitemap"
securityTrimmingEnabled="true" />
</providers>
</siteMap>
我的Web.sitemap如下......
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode>
<siteMapNode url="index.aspx" title=" Home | " description="Home Page" />
<siteMapNode url="" title=" Add | " description="Add a Record" >
<siteMapNode url="Add_a_Locum.aspx" title=" Add New Locum " description="Add a new Locum" />
</siteMapNode>
<siteMapNode url="" title=" View | " description="View Menu" >
<siteMapNode url="All_Locums.aspx" title="All Locums " description="View Locums" />
</siteMapNode>
<siteMapNode url="" title=" My Profile | " description="Profile Info" >
<siteMapNode url="login.aspx" title="View Profile" description="View" />
<siteMapNode url="" title="Edit Profile " description="Add or Edit" />
</siteMapNode>
<siteMapNode url="" title=" Vacancies |" description="My Vacancies" >
<siteMapNode url="" title="View All" description="All Vacancies" />
<siteMapNode url="" title="View Preferred" description="Preferred" />
</siteMapNode>
<siteMapNode url="" title="Locums |" description="Locum Pages" >
<siteMapNode url="~/Locums/Locumsonly.aspx" title="Locums Only" description="Restricted Page" />
</siteMapNode>
<siteMapNode url="" title=" Appointments | " description="Appointments">
<siteMapNode url="" title="My Calendar" description="Calendar"/>
</siteMapNode>
<siteMapNode url="" title=" FAQs | " description="FAQ" />
<siteMapNode url="" title=" Help |" description="Help" target="_blank"/>
<siteMapNode url="" title=" Contact Us | " description="Contact Us" />
</siteMapNode>
</siteMap>
认为问题与访问规则有关,我已经删除了所有访问规则,但这没有帮助。基本上如果“安全修整”启用为“真” - 我的菜单都没有显示,但如果我将设置更改为“假”,则整个菜单会显示,但显然不会修剪。
答案 0 :(得分:0)
在父siteMapNode上尝试:
<siteMapNode roles="*">
<siteMapNode url="index.aspx" title=" Home | " description="Home Page" />
...
</siteMapNode>