动态层次结构网站地图asp.net



嗨,我需要构建动态层次结构的站点地图。这是我的xml

<!--company tab-->
  <siteMapNode url="~/Module/EB/Company/CompanyList.aspx" title="Company list"  description="Company List"  >
    <siteMapNode url="~/Module/EB/Company/CompanyDetail.aspx" title="Company Detail Setup"  description="Company Detail Setup"  >
      <siteMapNode url="~/Module/EB/Employee/EmployeeDetail.aspx" title="Employee Detail Setup"  description="Employee Detail Setup" >
        <siteMapNode url="~/Module/EB/Employee/EmployeeDependentDetail.aspx" title="Employee Dependent Setup"  description="Employee Dependent Setup" >
        </siteMapNode>
      </siteMapNode>
    </siteMapNode>
  </siteMapNode>
  <!--company tab-->
  <!--Employee tab-->
  <siteMapNode url="~/Module/EB/Employee/EmployeeList.aspx" title="Employee list"  description="Employee List" >
     <siteMapNode url="~/Module/EB/Employee/EmployeeDetail.aspx" title="Employee Detail Setup"  description="Employee Detail Setup" >
        <siteMapNode url="~/Module/EB/Employee/EmployeeDependentDetail.aspx" title="Employee Dependent Setup"  description="Employee Dependent Setup" >
        </siteMapNode>
      </siteMapNode>
  </siteMapNode>

sitemenu.aspx

<asp:SiteMapPath ID="SiteMapPath1" runat="server" Font-Names="Microsoft New Tai Lue" 
                  Font-Size="0.9em" PathSeparator=" : " SkipLinkText="" Font-Bold="False" 
                  style="font-family: 'Times New Roman', Times, serif; font-size: small" 
                  Visible="True"  Enabled="false">
                  <CurrentNodeStyle ForeColor="#333333" Font-Underline="True" />
                  <NodeStyle Font-Bold="True" ForeColor="#284E98" />
                  <PathSeparatorStyle Font-Bold="True" ForeColor="#507CD1" />
                  <RootNodeStyle Font-Bold="True" ForeColor="#507CD1"  />
              </asp:SiteMapPath>

所以nw是我的问题。在我的公司选项卡中,我可以访问员工详细信息(EmployeeDetail.aspx)选项卡。在我的员工选项卡中,也可以访问员工详情.aspx

但是nw我得到了错误XmlSiteMapProvider要求站点地图节点具有唯一的URL

有什么解决方案吗?

我没有足够的声誉来对你的问题发表评论,但你有没有试过在员工详细信息链接的末尾放一个查询字符串。它不一定是你的代码明确引用的任何东西,只需要让它变得不同就可以了——例如:

<siteMapNode url="~/Module/EB/Employee/EmployeeDependentDetail.aspx?key=value1" title="Employee Dependent Setup"  description="Employee Dependent Setup" >

最新更新