2

启用安全修剪时,我的完整菜单系统未显示...

我在 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>

认为问题与访问规则有关,我删除了所有访问规则,但这并没有帮助。基本上,如果“安全修剪”启用为“真” - 我的菜单都没有显示,但如果我将设置更改为“假”,整个菜单都会显示,但显然不会修剪。

4

1 回答 1

0

在父 siteMapNode 上试试这个:

<siteMapNode roles="*">
<siteMapNode url="index.aspx" title=" Home | " description="Home Page" />
...
</siteMapNode>
于 2013-10-22T21:33:03.640 回答