MVC SiteMap 提供程序当前节点未设置
我正在使用 mvc3 站点地图提供程序在我的项目中显示站点地图和面包屑。我的情况如下
我将有一个静态站点地图,如下所示
<?xml version="1.0" encoding="utf-8" ?>
<mvcSiteMap xmlns="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-3.0" enableLocalization="true">
<mvcSiteMapNode title="Root" controller="Home" action="Index" id="0" refresh="always" visibility="InSiteMapOnly">
<mvcSiteMapNode title="Home" controller="Home" action="Index" id="1" key="Home"/>
<mvcSiteMapNode title="News and Events" controller="Home" action="About" id="2"/>
<mvcSiteMapNode title="Documents" controller="Home" action="About" id="3"/>
<mvcSiteMapNode title="Help" controller="Home" action="About" id="4"/>
<mvcSiteMapNode title="View Data" controller="Home" action="About" id="5"/>
<mvcSiteMapNode title="My Data" controller="Foo" action="Index" id="6" roles="Role1" key="MyData">
<mvcSiteMapNode title="1" controller="Part" action="Index" class="myRSRNav_contact" />
<mvcSiteMapNode title="2" controller="Part" action="Details" />
<mvcSiteMapNode title="3" controller="Part" action="Details" MakeVisible="Index"/>
<mvcSiteMapNode title="4" controller="Part" action="Details" class="myRSRNav_partsList" />
<mvcSiteMapNode title="5" controller="Part" action="Details" class="myRSRNav_import" roles="role1,role2" />
</mvcSiteMapNode>
<mvcSiteMapNode title="Messages" controller="Home" action="About" id="6" roles="RP"/>
<mvcSiteMapNode title="Reporting" controller="Home" action="About" id="7" roles="RP"/>
<mvcSiteMapNode title="Site map" controller="Home" action="Sitemap" id="8"/>
</mvcSiteMapNode>
</mvcSiteMap>
当我登录到应用程序时,我希望自动选择 mydata 选项卡,因为我正在路由到相应的位置控制器和动作。
现在它没有发生,但我单击它显示的 mydata 选项卡。任何想法
提前致谢。
谢谢, 阿贾伊
I am using mvc3 sitemap provider to show sitemap and breadcrumps in my project.My situation is as follows
I will be having a static sitemap as follows
<?xml version="1.0" encoding="utf-8" ?>
<mvcSiteMap xmlns="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-3.0" enableLocalization="true">
<mvcSiteMapNode title="Root" controller="Home" action="Index" id="0" refresh="always" visibility="InSiteMapOnly">
<mvcSiteMapNode title="Home" controller="Home" action="Index" id="1" key="Home"/>
<mvcSiteMapNode title="News and Events" controller="Home" action="About" id="2"/>
<mvcSiteMapNode title="Documents" controller="Home" action="About" id="3"/>
<mvcSiteMapNode title="Help" controller="Home" action="About" id="4"/>
<mvcSiteMapNode title="View Data" controller="Home" action="About" id="5"/>
<mvcSiteMapNode title="My Data" controller="Foo" action="Index" id="6" roles="Role1" key="MyData">
<mvcSiteMapNode title="1" controller="Part" action="Index" class="myRSRNav_contact" />
<mvcSiteMapNode title="2" controller="Part" action="Details" />
<mvcSiteMapNode title="3" controller="Part" action="Details" MakeVisible="Index"/>
<mvcSiteMapNode title="4" controller="Part" action="Details" class="myRSRNav_partsList" />
<mvcSiteMapNode title="5" controller="Part" action="Details" class="myRSRNav_import" roles="role1,role2" />
</mvcSiteMapNode>
<mvcSiteMapNode title="Messages" controller="Home" action="About" id="6" roles="RP"/>
<mvcSiteMapNode title="Reporting" controller="Home" action="About" id="7" roles="RP"/>
<mvcSiteMapNode title="Site map" controller="Home" action="Sitemap" id="8"/>
</mvcSiteMapNode>
</mvcSiteMap>
When i login to the application i want mydata tab to be automatically selected as i am routing to he corresponding controller and action.
Now it is not happening but ehen i click on the mydata tab it is showing.Any ideas
Thanks in advance.
Thanks,
Ajai
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
登录时重定向到 /Foo/Index 还是 /Foo/Index/6?我猜站点地图节点中的 id 参数会阻止您按预期进行这项工作。
Are you redirecting to /Foo/Index when you are logging in or to /Foo/Index/6? I guess the id parameter in the sitemap node is preventing you from having this work as expected.