开发者

MVC SiteMap provider current node not setting

开发者 https://www.devze.com 2023-03-15 16:28 出处:网络
I am using mvc3 sitemap provider to show sitemap and breadcrumps in my project.My situation is as follows

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 happe开发者_如何转开发ning but ehen i click on the mydata tab it is showing.Any ideas

Thanks in advance.

Thanks, Ajai


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号