我使用的是MVC3,C#,Razor,mvcSiteMapProvider V4。我似乎在MvcSiteMapProvider Breadcrumb踪迹中获得一个GUID,不知道为什么?
我使用 “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_Section” 路线做工精细。但是,当我进入“背景”路线时,我在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
任何想法可能是造成这个?
谢谢。
感谢这..真的很有帮助。这个GUID问题让我挠了挠头。 – SamJolly