MVC3、C#、Razor、mvcSiteMapProvider V4 を使用しています。
「Mvc.sitemap」を使用しています
<mvcSiteMapNode title="Reports" controller="Report" action="Index" preservedRouteParameters="ClientId" route="Report">
<mvcSiteMapNode key="Report_Section" title="Sections" controller="Section" action="FilterByReport" preservedRouteParameters="ClientId,ReportId" route="Report_Section">
<mvcSiteMapNode key="Background" title="Background" controller="Wizard" action="Index" preservedRouteParameters="ClientId,ReportID,SectionID,SectionName" route="Background"/>
"Global.asax" カスタム ルートは次のようになります。
routes.MapRoute("Report", "Report/{ClientId}", new { controller = "Report", action = "Index", ClientId = UrlParameter.Optional });
routes.MapRoute("Report_Section", "Report/{ClientId}/Section/{ReportId}", new { controller = "Section", action = "FilterByReport", ReportId = UrlParameter.Optional });
routes.MapRoute("Background", "Report/{ReportID}/SectionID/{SectionID}/SectionName/{SectionName}", new { controller = "Wizard", action = "Index", ReportID = UrlParameter.Optional, SectionID = UrlParameter.Optional, SectionName = UrlParameter.Optional });
「Report」および「Report_Section」ルートは正常に機能します。ただし、「Background」ルートに入ると、mvcSiteMap BreadCrumb URL の「Report_Section」および「Report」ルートのすべてのルート構造が失われます。代わりに、GUID を取得します。
http://localhost/7ebe9bb9-a663-43fd-9fb1-865866be12b9
これは、自動生成された XML ノード キーである可能性があります。ただし、クリックすると 404 が発生します。
次のようなものを取得する必要があります。
レポート
http://localhost/Report/10
セクション
http://localhost/Report/10/Section/100
これを引き起こしている可能性のあるアイデアはありますか?
ありがとう。