Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jan 2007
    Posts
    117
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Multiple sitemap files

    Hi guys -

    I have multiple sitemap files. If a user chooses one action, I want them to use Web.sitemap for their navigation. If they choose another action, I want them to use Web2.sitemap. The problem is that in the sitemap file, all your nodes must be unique, thus the need for 2 separate files since I have multiple files in both sitemap files.

    Example:

    Input:
    Login --> Default --> Report --> Voucher

    Approval:
    Login --> Path Choice --> Default --> Report --> Voucher
    Login --> Path Choice --> Pending --> Report --> Voucher
    Login --> Path Choice --> Checks --> Check Info

    What VB code do I use on my page load to use Web2.sitemap under one condition or use Web.sitemap under another?

    I also added the following code to my web.config file:

    <siteMap defaultProvider="Web" enabled="true">
    <providers>
    <add
    name="Web"
    type="System.Web.XmlSiteMapProvider"
    siteMapFile="Web.sitemap" />

    <add
    name="Web2"
    type="System.Web.XmlSiteMapProvider"
    siteMapFile="Web2.sitemap" />
    </providers>
    </siteMap>

    How do I switch between the two? Thanks.

  • #2
    Regular Coder
    Join Date
    Jan 2007
    Posts
    117
    Thanks
    4
    Thanked 2 Times in 2 Posts
    Just wanted to let you know I got this working. Missing a very minor piece.

    <siteMap defaultProvider="Web" enabled="true">
    <providers>
    <add name="Web" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Web.sitemap"/>
    <add name="Web2" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Web2.sitemap"/>
    </providers>
    </siteMap>

    I was missing the "~/" in front of the file name in the siteMapFile.

    I could then use Me.SiteMapPath1.SiteMapProvider = "Web" or Me.SiteMapPath1.SiteMapProvider = "Web2".


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •