parser error on menu control

S

Sandy Ryan

i'm accessing an xml sitemap
and my menu control states (in the design view)
"Error parsing control: A relative URI Cannot be created because the
'uristring' parameter represents an absolute URI.
also note when i run the page - i get the HOME link and the sub levels - but
not the items on the same level as home - (get the boxes but no links or
labels)
thanks
 
M

Mohamad Elarabi

I'm assuming you're using an <asp:SiteMapDataSource> control as your
DataSource for your <asp:Menu> control.

As for this error "Error parsing control: A relative URI Cannot be created
because the 'uristring' parameter represents an absolute URI" I think the
reason for this is because, most likely the URL attribute on the
SiteMapNode(s) in your sitemap file are absolute URLs as in
"http://myDomain/default.aspx" instead or relative URLs such as
"default.aspx" or "Admin/default.aspx" etc. Having http://... probably works
fine but perhaps not in design view.

If you're not getting other items on the same level as home do the following:
in the web.sitemap file surround your existing <siteMapNode> tags with
another siteMapNode that is blank. Your Sitemap file should look something
like this:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="" title="" description="">
<siteMapNode url="default.aspx" title="Home" description="My Home Page" />
<siteMapNode url="About.aspx" title="About" description="About Us" />
<siteMapNode url="Contact.aspx" title="Contact Us" description="Contact
Page" />
</siteMapNode>

After doing that go to your <asp:SiteMapDataSource> and add this attribute
ShowStartingNode="false" to it. so that the tag would look something like
this:

<asp:SiteMapDataSource runat="server" ID="SMDS" ShowStartingNode="false" />

And hopefully that helps.

If you're not getting link names or titles you must populate the Title=""
attribute for each siteMapNode in your siteMap file.

If you continue to have problems it would help me answer your question
better if you could post your <asp:Menu> tag and the <asp:SiteMapDataSource>
tag you're using. It would also help if you can post a small part of your
sitemap file.

Good luck.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top