2013-07-18 49 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