multiple sitemaps

Last post 07-24-2006 7:24 PM by audun.net. 9 replies.

Sort Posts:

  • multiple sitemaps

    07-22-2006, 3:14 PM
    • Member
      650 point Member
    • Dman100
    • Member since 07-11-2006, 7:06 PM
    • Posts 408

    how do you register multiple site maps in the web.config file?

    <?

    xml version="1.0"?>

    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

    <appSettings>

    <add key="ConnectionString" value="Password=xxxxxxx;Persist Security Info=True;User ID=username;Initial Catalog=DBNAME;Data Source=SERVERNAME" />

    </appSettings>

    <system.web>

    <compilation debug="true"/>

    <authentication mode="Windows"/>

    </system.web>

    </

    configuration>

    Also, how do I change the code for the menu and treeview controls to use <ul> tags for css friendly layouts rather than <table> tag generated html?

    Thank you.

  • Re: multiple sitemaps

    07-22-2006, 4:01 PM
    • Member
      650 point Member
    • Dman100
    • Member since 07-11-2006, 7:06 PM
    • Posts 408

    I tried adding the following to the web.config file:

    <?

    xml version="1.0"?>

    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

    <

    appSettings>

    <

    add key="ConnectionString" value="Password=Z1x2c3v4;Persist Security Info=True;User ID=dwayne;Initial Catalog=Compass;Data Source=DWAYNE-SERVER" />

    </

    appSettings>

    <

    system.web>

    <

    siteMap defaultProvider="XmlSiteMapProvider">

    <

    providers>

    <

    add name="TopNavigationBar" type="System.Web.XmlSiteMapProvider" siteMapFile="~/NavigationMenus/TopNavigationBar.sitemap" />

    <

    add name="LeftNavigationBar"type="System.Web.XmlSiteMapProvider" siteMapFile="~/NavigationMenus/LeftNavigationBar.sitemap" />

    </

    providers>

    </

    siteMap>

    <compilation debug="true"/>

    <authentication mode="Windows"/>

    </system.web>

    </

    configuration>

    But, I recieved the following error: the provider 'XmlSiteMapProvider' specified for the defaultProvider does not exist in the providers collection.

  • Re: multiple sitemaps

    07-22-2006, 11:32 PM
    • Member
      650 point Member
    • Dman100
    • Member since 07-11-2006, 7:06 PM
    • Posts 408
    Please disregard....I figured it out.
  • Re: multiple sitemaps

    07-24-2006, 11:59 AM
    • Participant
      847 point Participant
    • ganseki
    • Member since 05-18-2006, 9:59 PM
    • England
    • Posts 157
    Could you explain what the solution was please?
    I'm trying to use multiple sitemaps in a new project but the examples I've found on MSDN don't seem to work.
    Simon
    Sharing Knowledge Saves Valuable Time!
    www.sjmdev.com
  • Re: multiple sitemaps

    07-24-2006, 12:58 PM
    • Member
      650 point Member
    • Dman100
    • Member since 07-11-2006, 7:06 PM
    • Posts 408

    Hi,

    Yeah, it took me several days to figure this out.

    In your web.config file this is what you need to add under the <system.web> tag:

    <system.web>

    <siteMap defaultProvider="AspNetXmlSiteMapProvider">

    <providers>

    <add name="TopXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider"siteMapFile="TopNavigationBar.sitemap" />

    <add name="LeftXmlSiteMapProvider"type="System.Web.XmlSiteMapProvider" siteMapFile="LeftNavigationBar.sitemap" />

    </providers>

    </siteMap>

     

    defaultProvider="AspNetXmlSiteMapProvider" specifies your default web.sitemap file.

    In my case, I added two additional providers:

    <add name="TopXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider"siteMapFile="TopNavigationBar.sitemap" />

    &

    <add name="LeftXmlSiteMapProvider"type="System.Web.XmlSiteMapProvider" siteMapFile="LeftNavigationBar.sitemap" />

    So, in whenever you add your control you will want to reference the provider used in your web.config file like so:

    <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" SiteMapProvider="LeftXmlSiteMapProvider" ShowStartingNode="False" />

    Notice: SiteMapProvider="LeftXmlSiteMapProvider"

    This is the name of the provider you specify in the web.config file

    Obviously you can change the names accordingly to suit your needs.

    Hope this helps.

    Regards,

    -D-

  • Re: multiple sitemaps

    07-24-2006, 3:11 PM
    • Member
      60 point Member
    • oclvtrek
    • Member since 10-18-2005, 2:38 PM
    • Virginia, USA
    • Posts 12

    Dman, thank you very much!

    I was right in the mind of struggling with this when I stumbled upon your post.

    - Cheers

  • Re: multiple sitemaps

    07-24-2006, 3:32 PM
    • Member
      650 point Member
    • Dman100
    • Member since 07-11-2006, 7:06 PM
    • Posts 408
    You're welcome...glad to help.
  • Re: multiple sitemaps

    07-24-2006, 6:47 PM
    • Member
      423 point Member
    • audun.net
    • Member since 07-24-2006, 6:14 PM
    • Posts 283

    Hey guys!

    I have problem understanding this. From what I see above in this thread the SiteMapProvider set as defaultProvider isn't in the providers collection

    So I tryed with this web.config settings:
    <siteMap defaultProvider="ASPLoggedIn">
      <providers>
        <add name="LoggedIn" type="System.Web.XmlSiteMapProvider" siteMapFile="LoggedIn.sitemap"/>
        <add name="Anonymous" type="System.Web.XmlSiteMapProvider" siteMapFile="Anonymous.sitemap"/>
      </providers>
    </siteMap>

    But I get this error when running my web application:
    The provider 'ASPLoggedIn' specified for the defaultProvider does not exist in the providers collection

    Any suggestions?

    Audun

    Funny Quotes makes me laugh :)


  • Re: multiple sitemaps

    07-24-2006, 6:59 PM
    • Member
      650 point Member
    • Dman100
    • Member since 07-11-2006, 7:06 PM
    • Posts 408

    Hi Audun,

    Yes, that can be confusing.

    change to this:

    <siteMap defaultProvider="AspNetXmlSiteMapProvider">
      <providers>
        <add name="LoggedIn" type="System.Web.XmlSiteMapProvider" siteMapFile="LoggedIn.sitemap"/>
        <add name="Anonymous" type="System.Web.XmlSiteMapProvider" siteMapFile="Anonymous.sitemap"/>
      </providers>
    </siteMap>

    this is simply specifying that your default provider is web.sitemap.  You don't have to define that in the provider collection.  New providers you wish to add need to be defined in the collection.

    See if that corrects the error.

  • Re: multiple sitemaps

    07-24-2006, 7:24 PM
    • Member
      423 point Member
    • audun.net
    • Member since 07-24-2006, 6:14 PM
    • Posts 283

    Thanks, so it need to be "AspNetXmlSiteMapProvider" I thought any word was okay!

    It fixed the error, thank you :-)

    Audun

     

    Funny Quotes makes me laugh :)


Page 1 of 1 (10 items)