2013-07-18 51 views
0

嗨,我需要建立动态层次结构网站地图。下面是我的XML动态层次结构网站地图asp.net

<!--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)选项卡。在我的员工选项卡中,我也可以访问员工detail.aspx

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

任何解决方案?

+0

我有这个问题曾经和使用URL路由来解决这个问题。 – Alexander

+0

请给我例子 – user998405

回答

0

我没有足够的声望发表评论到你的问题,但你有没有尝试过把查询字符串放在你的员工详细信息链接的末尾。它不必须是任何你的代码是指显式地,就足以使它不同 - 例如:

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

嗨,谢谢你的评论。但我不嘲笑它可以为我工作。 COS在我的网址我GT几个查询字符串。我可能会得到错误,它不匹配的网址 – user998405

+0

对不起,响应速度慢 - 你可以在运行时动态改变siteMapNode - 如果你看这个链接,它可以帮助你分配你需要的键/值对 - http:// msdn。 microsoft.com/en-us/library/system.web.sitemap.sitemapresolve.aspx – KerSplosh

+0

好的。谢谢我先尝试 – user998405