2012-10-21 51 views
1

我使用MvcSiteMapProvider 3.3.3.0和具有文件MvcSiteMap.sitemap包含定义两个节点如下:MVCSitemapProvider当前节点没有检测

<mvcSiteMapNode title="Node1" controller="MyController" action="MyAction" type="A" /> 
<mvcSiteMapNode title="Node2" controller="MyController" action="MyAction" type="B" /> 

我在的global.asax.cs路由配置的“开箱即用”,这样的网址是:

Node 1: http://server/MyController/MyAction?type=A 
Node 2: http://server/MyController/MyAction?type=B 

现在,如果我浏览到节点2,我发现MenuHelper.GetCurrentNode()返回节点1

这是为什么,我有没有办法让MvcSiteMapProvider根据查询字符串参数识别当前节点?

回答

0

不幸的是,没有办法做到这一点。 我用自定义的DynamicNodeProvider解决了这个问题,但它似乎不适合你的情况。