lang79james
02-15-2008, 09:27 PM
Ok I like to start of saying I am a newbie doing the as an hobby. After rebuilding my website with .aspx format I came across sitemaps and not knowing that much about them I pretty much made one file that would be my menu file and use the include file on all my pages from code I found online. Now that is nice and all but I want to make a second sitemap and be able to link to it but I dont know how seeing how I never got how to do the first one. After doing some reading I came across how to configure the web.config file to support more then one site map. My web.config file is setup like this:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.web>
<customErrors mode="Off" />
<authentication mode="Windows"/>
<siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
<providers>
<clear />
<add name="XmlSiteMapProvider"
description="Default SiteMap provider"
type="System.Web.XmlSiteMapProvider"
siteMapFile="Web.sitemap"
/>
<add name="StorySiteMap"
description="Story SiteMap provider"
type="System.Web.XmlSiteMapProvider"
siteMapFile="story/story.sitemap"
/>
</providers>
</siteMap>
</system.web>
</configuration>
Now my Question is how do I use the StorySitemap and not the default one.
The code I found that I am using for the default sitemap is:
<form id="form1" runat="server">
<table cellpadding="8">
<tr>
<td width="108" rowspan="2" valign="top" bgcolor="#990000">
<b><i>Menu Control</i></b>
<br />
<br />
<asp:Menu DataSourceID="SiteMapDataSource1" ID="Menu1" runat="server"
StaticDisplayLevels="2" BackColor="#FFFBD6"
DynamicHorizontalOffset="2" Font-Names="Verdana"
ForeColor="#990000" StaticSubMenuIndent="10px">
<StaticSelectedStyle BackColor="#FFCC66" />
<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<DynamicMenuStyle BackColor="#FFFBD6" />
<DynamicSelectedStyle BackColor="#FFCC66" />
<DynamicMenuItemStyle HorizontalPadding="5px"
VerticalPadding="2px" />
<DynamicHoverStyle BackColor="#990000" Font-Bold="False"
ForeColor="White" />
<StaticHoverStyle BackColor="#990000" Font-Bold="False"
ForeColor="White" />
</asp:Menu>
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
</td>
</table>
<br /><br />
</form></P>
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.web>
<customErrors mode="Off" />
<authentication mode="Windows"/>
<siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
<providers>
<clear />
<add name="XmlSiteMapProvider"
description="Default SiteMap provider"
type="System.Web.XmlSiteMapProvider"
siteMapFile="Web.sitemap"
/>
<add name="StorySiteMap"
description="Story SiteMap provider"
type="System.Web.XmlSiteMapProvider"
siteMapFile="story/story.sitemap"
/>
</providers>
</siteMap>
</system.web>
</configuration>
Now my Question is how do I use the StorySitemap and not the default one.
The code I found that I am using for the default sitemap is:
<form id="form1" runat="server">
<table cellpadding="8">
<tr>
<td width="108" rowspan="2" valign="top" bgcolor="#990000">
<b><i>Menu Control</i></b>
<br />
<br />
<asp:Menu DataSourceID="SiteMapDataSource1" ID="Menu1" runat="server"
StaticDisplayLevels="2" BackColor="#FFFBD6"
DynamicHorizontalOffset="2" Font-Names="Verdana"
ForeColor="#990000" StaticSubMenuIndent="10px">
<StaticSelectedStyle BackColor="#FFCC66" />
<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<DynamicMenuStyle BackColor="#FFFBD6" />
<DynamicSelectedStyle BackColor="#FFCC66" />
<DynamicMenuItemStyle HorizontalPadding="5px"
VerticalPadding="2px" />
<DynamicHoverStyle BackColor="#990000" Font-Bold="False"
ForeColor="White" />
<StaticHoverStyle BackColor="#990000" Font-Bold="False"
ForeColor="White" />
</asp:Menu>
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
</td>
</table>
<br /><br />
</form></P>