tags:

views:

251

answers:

3

I have a asp:menu object which I set up to use a SiteMapDataSource but everytime I try to run the site, I get a yellow screen from firefox saying it cannot find the web.sitemap. Here's the code for the sitemapdatasource and the menu. The Web.sitemap file is sitting in the root directory of the website.

<div>
        <asp:Menu ID="MainMenu" CssClass="wTheme" Orientation="Horizontal" runat="server" DataSourceID="SiteMapDataSource1">
        </asp:Menu>
        <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" SiteMapProvider="Web.sitemap" />
    </div>

And this is the Web.sitemap looks like so:

<?xml version="1.0" encoding="utf-8" ?>

+1  A: 

I had a similar problem where I was specifying the path to the SiteMap from within my DataSource control. I tried removing it and it worked.

Try removing the path from the SiteMapDataSource and ensure that web.sitemap is in the root directory and see if that fixes it.

Colorado
A: 

You need to specify in web.config to use XmlSiteMapProvider and provide it with correct path to .sitemap file.

dimarzionist
A: 

Could you specify in what section XmlSiteMapProvider needs to be placed?

@Colorado Removing the SiteMapDataSource did fix the problem, but there must be a cleaner way to do it.

Matt R