external links using a sitemap, 2.0

F

fernandezr

I've successfully created a dynamic menu pulling data from a database
however all links thus far have all been virtual urls such as
/ABCD/default.aspx, /ABCD/profile.aspx, etc. Now I want to add urls
that are external to my site such as
http://www.rathergood.com/moon_song/ or http://www.cnn.com but when I
try to use these I get
"Exception Details: System.Web.HttpException:
'http://www.rathergood.com/moon_song/' is not a valid virtual path.".

It is failing on the AddNode method of StaticSiteMapProvider. I've
even tried
/ABCD/externalURL.aspx?url=http://www.rathergood.com/moon_song/ and
still get the same error.

Is there a way for me to reference an external url without having to
hardcode it into my page?

Thanks,
Happy Wednesday,
Robert
 
G

Guest

I am having the same problem. I am using the SqlSiteMapProvider class found
in the Feb 2006 MSDN Magazine. If I use the out-of-the-box
XmlSiteMapProvider, I can use an external URL just fine. Looks like both
providers derive from StaticSiteMapProvider, and SqlSiteMapProvider doesn't
override the AddNode method. There must be a reason...
 
Joined
Aug 4, 2006
Messages
1
Reaction score
0
external urls in a sitemap

I had the same problem. The check on virtual directories is done when the
node is added. However if you alter the properties afterwards eg
node.url = "http://localhost/" + node.url
it doesn't check it. So you can have any kind of url (except duplicates) but not before the node is added. Hope that helps.:-D
 

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

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top