CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 4/19/2007 8:18:17 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 5 Views: 38 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
6 Items, 1 Pages 1 |< << Go >> >|
thompgm
Asp.Net User
Multiple SiteMap Files One Site4/19/2007 8:18:17 PM

0/0

I have been working from the article: How to: Configure Multiple Site Maps and Site-Map Providers (http://msdn2.microsoft.com/en-us/library/ms178426.aspx) I am not able to make it work. For simplicity of asking this question in a forum, I have created a basic website that contains a Web.config file and a Web.sitemap in the root folder. Also in the root folder are two folders: WebSite1 and WebSite2. When I try to run one of the sites I get the following error. Parser Error Message: The provider 'XmlSiteMapProvider' specified for the defaultProvider does not exist in the providers collection. I have pasted the pieces of code that are neccessary to look at below. Please help push me in the right direction.
Thanks,
Greg

Web.config

 <siteMap defaultProvider="XmlSiteMapProvider">

<

providers>

<

add

name="WebSite1SiteMap"

type="System.Web.XmlSiteMapProvider"

siteMapFile="~/WebSite1/WebSite1.sitemap" />

<

add

name="WebSite2SiteMap"

type="System.Web.XmlSiteMapProvider"

siteMapFile="~/WebSite2/WebSite2.sitemap" />

</

providers>

</

siteMap>
Web.sitemap  

<?

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

<

siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

<

siteMapNode>

<

siteMapNode siteMapFile="~/WebSite1/WebSite1.sitemap"/>

<

siteMapNode siteMapFile="~/WebSite2/WebSite2.sitemap"/>

</

siteMapNode>

</

siteMap>
/Website1/WebSite1.sitemap

<?

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

<

siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

<

siteMapNode provider="WebSite1SiteMap">

<

siteMapNode url="Default.aspx" title="Default" description="Default of Site 1" />

<

siteMapNode url="Default2.aspx" title="Default2" description="Default2 of Site 1" />

<

siteMapNode url="Default3.aspx" title="Default3" description="Default3 of Site 1" />

</

siteMapNode>

</

siteMap>
  /Website1/WebSite1.master
<asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1">
</asp:Menu>
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" SiteMapProvider="WebSite1SiteMap" />
Zhao Ji Ma - MS
Asp.Net User
Re: Multiple SiteMap Files One Site4/23/2007 8:30:45 AM

0/0

Hi Greg,

1. The configuration listed in http://msdn2.microsoft.com/en-us/library/ms178426.aspx is not a full list of web.config file. You need to add the sample section into web.config file and modify it. Here is an example:

<?xml version="1.0"?>

 

<configuration>

 

        <appSettings/>

        <connectionStrings/>

 

        <system.web>

                <!--

            The <authentication> section enables configuration

            of the security authentication mode used by

            ASP.NET to identify an incoming user.

        -->

                <authentication mode="Windows" />

                <!--

            The <customErrors> section enables configuration

            of what to do if/when an unhandled error occurs

            during the execution of a request. Specifically,

            it enables developers to configure html error pages

            to be displayed in place of a error stack trace.

 

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

            <error statusCode="403" redirect="NoAccess.htm" />

            <error statusCode="404" redirect="FileNotFound.htm" />

        </customErrors>

        -->

 

                <siteMap>

 

                        <providers>

                                <add name="WebSite1SiteMap"

                                        description="Default SiteMap provider."

                                        type="System.Web.XmlSiteMapProvider"

                                        siteMapFile="~/WebSite1/WebSite1.sitemap"

                                />

                                <add name="WebSite2SiteMap"

                                        description="Default SiteMap provider."

                                        type="System.Web.XmlSiteMapProvider"

                                        siteMapFile="~/WebSite2/WebSite2.sitemap"

                                />

                        </providers>

 

                </siteMap>

        </system.web>

</configuration>

2. According to the configuration, there should be two sitemap files.

/WebSite1/WebSite1.sitemap

/WebSite2/WebSite2.sitemap

However only one is provided, intead there is a Web.sitemap file.

thompgm:

Web.sitemap  

<?

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

<

siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

<

siteMapNode>

<

siteMapNode siteMapFile="~/WebSite1/WebSite1.sitemap"/>

<

siteMapNode siteMapFile="~/WebSite2/WebSite2.sitemap"/>

</

siteMapNode>

</

siteMap>
/Website1/WebSite1.sitemap

<?

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

<

siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

<

siteMapNode provider="WebSite1SiteMap">

<

siteMapNode url="Default.aspx" title="Default" description="Default of Site 1" />

<

siteMapNode url="Default2.aspx" title="Default2" description="Default2 of Site 1" />

<

siteMapNode url="Default3.aspx" title="Default3" description="Default3 of Site 1" />

</

siteMapNode>

</

siteMap>

If this file is not configured in web.config, it will be be used by ASP.NET at all. Please check this too.

 


Zhao Ji Ma
Sincerely,
Microsoft Online Community Support

?Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ?
thompgm
Asp.Net User
Re: Multiple SiteMap Files One Site4/23/2007 2:21:40 PM

0/0

Thank you for your reply I have made some changes, however I now get a error that states: WebDev.WebServer.exe has encountered a problem and needs to close. 

So now my website structure looks like this:

  • SampleWebsite
    • WebSite1 (folder)
      • Default.aspx
      • Default2.aspx
      • Default3.aspx
      • WebSite1.master
      • WebSite1.sitemap
    • WebSite2 (folder)
      • Default.aspx
      • Default2.aspx
      • Default3.aspx
      • WebSite2.master
      • WebSite2.sitemap
    • Web.config

 I copied and pasted your Web.config code so that should be fine. I deleted the web.sitemap in the root folder. I will paste the code for my WebSite1.master and my WebSite1.sitemap below. Please note that my WebSite2 content is exactly the same except for replaceing 1 with 2 where appropriate.

WebSite1.master

<%

@ Master Language="C#" AutoEventWireup="true" CodeFile="WebSite1.master.cs" Inherits="WebSite1_WebSite1" %>

<!

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<

html xmlns="http://www.w3.org/1999/xhtml" >

<

head runat="server">

<title>Untitled Page</title>

</

head>

<

body>

<form id="form1" runat="server">

<div>

<asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1">

</asp:Menu>

<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" SiteMapProvider="WebSite1SiteMap" />

<br />

<br />

<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">

</asp:contentplaceholder>

</div>

</form>

</

body>

</

html>

WebSite1.sitemap

<?

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

<

siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

<

siteMapNode provider="WebSite1SiteMap">

<

siteMapNode url="Default.aspx" title="Default" description="Default of Site 1" />

<

siteMapNode url="Default2.aspx" title="Default2" description="Default2 of Site 1" />

<

siteMapNode url="Default3.aspx" title="Default3" description="Default3 of Site 1" />

</

siteMapNode>

</

siteMap>

Any Thoughts? Thanks, Greg

Zhao Ji Ma - MS
Asp.Net User
Re: Multiple SiteMap Files One Site4/24/2007 9:08:11 AM

0/0

Hi,

The error usually means the ASP.NET Development Server crashes. I've found a similar thread:

http://forums.asp.net/thread/1600311.aspx

When Dev Server crashes it does not necessarily mean there is a bug in Dev Server. Your code might crash it too. So please check

Default.aspx

Default1.aspx

Default2.aspx

You can try to add a new page and select the WebSite1.master as the Master Page to verify if the new page crashes too. I think this can help narrow down the issue.


Zhao Ji Ma
Sincerely,
Microsoft Online Community Support

?Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ?
thompgm
Asp.Net User
Re: Multiple SiteMap Files One Site5/2/2007 8:54:43 PM

0/0

Zhao,

Thank you for your reply, sorry it has been so long for my response... didn't mean to be rude, just busy. I tried creating a new page under WebSite1.master and it crashes as well. Do you have any ideas, or do you know of a working example similar to what I am trying to achieve? Perhaps I could start with that code and modify to meet my needs.

 Thanks,
Greg

Zhao Ji Ma - MS
Asp.Net User
Re: Multiple SiteMap Files One Site5/7/2007 8:12:55 AM

0/0

Greg,

I'll email a simple sample project to you.


Zhao Ji Ma
Sincerely,
Microsoft Online Community Support

?Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ?
6 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Professional ASP.NET 3.5: In C# and VB Authors: Bill Evjen, Scott Hanselman, Devin Rader, Pages: 1673, Published: 2008
Beginning ASP.NET 3.5: In C# and VB Authors: Imar Spaanjaars, Pages: 734, Published: 2008
ASP.NET 2.0 Website Programming: Problem-design-solution Authors: Marco Bellinaso, Pages: 576, Published: 2006
Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages Authors: Jacob J. Sanford, Pages: 474, Published: 2007
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005
Pro ASP.NET 2.0 in C# 2005: Create Next-generation Web Applications with the Latest Version of Microsoft's Revolutionary Technology Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1426, Published: 2006
Pro ASP.NET 2.0 in VB 2005: From Professional to Expert Authors: Laurence Moroney, Matthew MacDonald, Pages: 1253, Published: 2006
Pro C# 2008 and the .NET 3.5 Platform Authors: Andrew Troelsen, Pages: 1370, Published: 2007
ASP.NET 2.0 All-In-One Desk Reference For Dummies: all-in-one desk reference for dummies Authors: Doug Lowe, Jeff Cogswell, Ken Cox, Pages: 910, Published: 2006

Web:
Google Webmaster Tools Using Sitemap index files (to group multiple sitemap files) ..... Individual Sitemaps (one for each site) that all reside in a single location. For example: ...
sitemaps.org - Protocol If you site includes more than 50000 URLs, you can separate the list into multiple text files and add each one separately. The text file must use UTF-8 ...
Using Multiple Sitemap Files This is great if you only want one file, but what if you want multiple sitemap files? Implementing this functionality is pretty easy: ...
Multiple SiteMap Files One Site - ASP.NET Forums For simplicity of asking this question in a forum, I have created a basic website that contains a Web.config file and a Web.sitemap in the ...
How to: Configure Multiple Site Maps and Site-Map Providers However, you might want to use more than one site-map file or site-map ... To configure multiple site maps for a single site, you start with a site map in ...
How can I use multiple sitemap file without multiple root nodes ... You could use jQuery and the superfish plugin on the front end and use C# to read your site map files on the back end to build the menuing structure. ...
Sitemaps - Wikipedia, the free encyclopedia A Sitemap is an XML file that lists the URLs for a site. .... Multiple sitemap files are supported, with a Sitemap index file serving as an entry point for ...
CodeProject: Using Multiple Sitemap Files in ASP.NET 2.0. Free ... Using Multiple Sitemap Files in ASP.NET 2.0. By Doug Wilson An article on how to use mutliple sitemap files for your site navigation. C#, XML, Windows, . ...
Multiple Sitemap Index Files in Robots.txt - Webmaster Forum Default Multiple Sitemap Index Files in Robots.txt ... You should know one thing : your site's sitemap url, it can be just an XML sitemap or ...
Custom SitemapProvider with multiple sitemap files - Rinze Cats' Blog When using multiple sitemap files, you'll find the custom provider is used for your ... whenever you apply the siteMapFile attribute on one of your nodes. ...

Videos:
Affiliate Summit 2006 East -- Straight Talk on Search Engine Optimization Brief presentation on Search Engine Optimization with a heavy focus on Q&A. A very open, honest and straight to the point discussion about search eng...




Search This Site:










master page folder level

when running my application home.aspx, it did not show excatly the way its supposed to be in.

question:master page + sitemap

menu navigation in .net 2.0

applying a different master page to a different part of the site

usercontrol + sitemapdatasource + multiview

absolute positioning problem with masterpages

bind treeview to ms access database (vb)

clicktoopen a dynamic menu

loading entire content page inside an update panel

accessing masterpage properties inside a usercontrol

skin ajax extender

customizing layout of wizard control

adding javascript to page that uses masterpage

master/ content page: how to invoking button click event?

help a newb "update a labels text on a masterpage from a content page" please.

facing problem with tree view control after deploying the asp.net app in other machine.

how to access a menu that a exists in a master page from other page (vb.net)

treeview control and xml

submenu indent?

one masterpage/sitemap multiple projects

masterpage + javascript problem

stopping redundancy on content pages

help with maintainscrollpositiononpostback on a dedicated secure server ssl

menu item not selecting

css menu controls with images

menu control posting back rather than navigating to a url

simple navbar user-control with state?

skin file

about theme questions.

  Privacy | Contact Us
All Times Are GMT