473,672 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 'AspNetXmlSiteM apProvider' 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.dt d">

<SCRIPT runat="server"& gt;
private void Page_Load(objec t sender, System.EventArg s e)
{

IEnumerator providers = SiteMap.Provide rs.GetEnumerato r();
while (providers.Move Next())
{
Response.Write( providers.Curre nt);
}
}

I am getting the output: System.Web.XmlS iteMapProvider

So I think it should find it. Or is it System.Web.XmlS iteMapProvider
different to AspNetXmlSiteMa pProvider?

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.Collecti ons.Generic;
3 using System.Componen tModel;
4 using System.Text;
5 using System.Web;
6 using System.Web.UI;
7 using System.Web.UI.W ebControls;
8
9 namespace MyControls
10 {
11 [ToolboxData("&l t;{0}:NiftyMenu
runat=server></{0}:NiftyMenu>" )]
12 public class NiftyMenu : WebControl
13 {
14 protected override void RenderContents( HtmlTextWriter
output)
15 {
16 RenderMasterMen u(output);
17 }
18
19 protected virtual void RenderMasterMen u(HtmlTextWrite r
output)
20 {
21 output.Write("& lt;ul id=\"nav\"&gt;" );
22 // The following line produces the exception
23 SiteMapNode node = SiteMap.Current Node;
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 2680

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

Similar topics

5
1162
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 class file that inherits from StaticSiteMapProvider. I call initialize from the default.aspx.cs and pass in the connection string. I then call BuildSiteMap which is in the class from default.aspx.cs. In BuildSiteMap I want to walk the child nodes...
1
2040
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> <sitemapnode site="City1"> <sitemapnode name="home" ... /> ***other menu items here*** </sitemapnode> <sitemapnode site="City2">
2
1716
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 shared pages which I'd rather not have. Both sites use a master page and a Menu control bound to a SiteMap. When a user loads the intranet home page, I want the appropriate Master Page to load. As both sites are on different subnets, I can...
7
1409
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 get your site more likely to be indexed. Do we therefore use Googles, the standard web.sitemap file, or both?? If anyone has used the Google version, is there any way of getting it to work with the TreeView and SiteMapPath controls?
4
3278
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 .ashx Asp.Net file that when the .ashx file is
0
1072
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: "Error Rendering Control - NiftyMenu1 An unhandled exception has occurred. The provider 'AspNetXmlSiteMapProvider' specified for the defaultProvider does not exist in the providers collection."
5
15062
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 simply persist any changes i made, but it doesn't happen. e.g. selected.ParentNode.ChildNodes.Remove(selected); throws a NotSupportedException "Collection is read-only"
0
2200
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 redirects to a page with a menu control associated to a SiteMapDataSource. I want to hide pg1 for all non-members of role manager (=user2).
0
1305
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 TreeView--- Sitemapdatasource---common.sitemap in Loginuser.master, there is another Navigation control: TreeView TreeView---sitemapdatasource---loginuser.sitemap
0
8505
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8947
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7479
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6261
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4245
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2844
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2097
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1842
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.