Help needed with .NET navigation controls!!!

R

rinishrk

I have an webapplication named Website1 with subfolders Admin and User
within it that contain web pages.I am generating a tree view for the
website that should allow me to have child nodes that redirect me to
public websites such as "www.yahoo.com" or "www.google.com". I created
a sitemap which looks as follows

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="/Home.aspx" title="Root" description="Root">
<siteMapNode url="/Admin/EditUser.aspx" title="Edit User"
description="Edit User" />
<siteMapNode url="/User/LoginFrom.aspx" title="LoginFrom"
description="LoginFrom" />
<siteMapNode url="www.google.com" title="Google"
description="Google" />
<siteMapNode url="www.yahoo.com" title="Yahoo"
description="Yahoo" />
</siteMapNode>
</siteMap>

But when the tree view get rendered,and i click on the child node
"Yahoo", it redirects me to the following link
"http://localhost/Website1/www.yahoo.com" instead of "www.yahoo.com" as
mentioned in the sitemap which is wrong.
Why does the treeview control append the virtual path of my website
i.e(http://localhost/Website1/)to each url i mention in the sitemap
when rendering the nodes????
How can i prevent it from doing so????
 
R

rinishrk

thanx for ur reply Ciaran....it works for the sitemap

I actually get the hierarchical data from the SQL database and i have a
custom sitemap provider that inherits StaticSiteMapProvider to fill the
tree,it gives me an error for the AddNode(SiteMapNode,SiteMapNode)
defined in StaticSiteMapProvider which i use in the overridden
BuildSiteMap() function in my custom provider stating
"'http://www.yahoo.com' is not a valid virtual path." It gives no error
if i eliminate the "http://", but then the generated node doesnt
redirect me to yahoo.com as required.
As it was not allowing me to do so in the database, i was trying it
out on a sitemap. Now that it is possible with the sitemap,it should
also work in case of the database. Can anybody help???
 

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