views:

100

answers:

0

I have created a Custom Server Control that renders the SiteMap as a pure UL for CSS styling.

At run-time it renders properly but in VS2008 Design View VS shows this error:

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

I have 'AspNetXmlSiteMapProvider' specified in web.config as per here : link text While I am happy that the code runs properly, the Designer error is bothersome if the underlying issue might cause the code to break in some circumstances so I need to understand what is going on...

The code explicitly references the sitemap in the Render Method with :

int level = 1;
string ul = string.Format("<div class='{0}' id='{1}'>{2}</div>", CssClassName, this.ID.ToString(), EnumerateNodesRecursive(SiteMap.RootNode, level));
output.Write(ul);

and the recursive method called referrences SiteMap.CurrentNode. Otherwise there are no explicit sitemap references in the code.

Does anyone have any ideas why Deisgner is complaining?