473,405 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Exception using Sitemap class

I am writing a custom control (code see below) and I am getting an
exception that drives me crazy.

When I drag my control on a form, Visual Studio shows immediately the
following exception:

"Error Rendering Control - NiftyMenu1 An unhandled exception has
occurred. The provider 'AspNetXmlSiteMapProvider' specified for the
defaultProvider does not exist in the providers collection."

What does that mean exactly? For debugging purpoes I list my providers
with the following code:

<%@ Page Language="C#" %>
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<SCRIPT runat="server"&gt;
private void Page_Load(object sender, System.EventArgs e)
{

IEnumerator providers = SiteMap.Providers.GetEnumerator();
while (providers.MoveNext())
{
Response.Write(providers.Current);
}
}

I am getting the output: System.Web.XmlSiteMapProvider

So I think it should find it. Or is it System.Web.XmlSiteMapProvider
different to AspNetXmlSiteMapProvider?

What am I missing? Must be something obvious but I can't see it.

Any help is very much appreciated.



Here is the code of my control:

1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Text;
5 using System.Web;
6 using System.Web.UI;
7 using System.Web.UI.WebControls;
8
9 namespace MyControls
10 {
11 [ToolboxData("&lt;{0}:NiftyMenu
runat=server></{0}:NiftyMenu>")]
12 public class NiftyMenu : WebControl
13 {
14 protected override void RenderContents(HtmlTextWriter
output)
15 {
16 RenderMasterMenu(output);
17 }
18
19 protected virtual void RenderMasterMenu(HtmlTextWriter
output)
20 {
21 output.Write("&lt;ul id=\"nav\"&gt;");
22 // The following line produces the exception
23 SiteMapNode node = SiteMap.CurrentNode;
24 }
25 }
26 }

The offending line is #23. If I comment that out the exception is
gone. But I need the SiteMap class!

Oct 27 '06 #1
0 1062

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Andy Sutorius via DotNetMonster.com | last post by:
I don't know if what I am trying to do can be done with sitemap. Let me bounce this arch. off of you and give me your opinion. I have a default.aspx that i have a treeview/web.sitemap in. I have a...
1
by: mike | last post by:
I have 2 sites in my company. My .NET site uses a master page and a Menu control connected to a sitemap. In my sitemap file I would like to be able to do something like this: <sitemap>...
2
by: mike | last post by:
I'm using ASP.NET 2.0 and IIS 6 I've got a business with 2 sites requiring separate intranet info. Currently, I have 2 separate intranet sites set up in IIS. This leads to having to double up on...
7
by: JJ | last post by:
I'm playing aournd with my first asp.net 2.0 web site and looking at the Web.sitemap file. It seems there's a lot of publicity at the moment about Google's sitemaps and how they are supposed to...
4
by: shapper | last post by:
Hello, I am trying to convert an Asp.Net 2.0 XML sitemap file to a Google's sitemap file. I am posting the formats of both files. 1. How can I do the conversion? 2. And can I use an...
0
by: dirk | last post by:
I am writing a custom control (code see below) and I am getting an exception that drives me crazy. When I drag my control on a form, Visual Studio shows immediately the following exception: ...
5
by: Tim Mackey | last post by:
hi, i have put my web.sitemap in /App_Data so i can edit it programatically via a web admin page, inheriting the modify permissions from the App_Data folder etc. i was hoping the provider would...
0
by: Chris | last post by:
Hi, i have a problem with the visibility of my sitemap. There is one role defined: "manager" There are two users: 'user1' (member of role manager) and 'user2' (not member). The login.aspx...
0
by: vingomail | last post by:
Good Morning, I have two site map: "common.sitemap, loginuser.sitemap", two master page:" common.master, loginuser.master", in common.master, there is a Navigation control: TreeView...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.