Referencing external URLs in your web.sitemap in ASP.NET

by James Fielding 23. February 2010 09:57

In ASP.NET, we often use site maps to set up navigation, particularly for menus. By default, the ASP.NET  site-map provider  uses the "Web.sitemap" file. Here is an example of this file for a simple site:


<?xml version="1.0" encoding="utf-8" ?>
<siteMap>
    <siteMapNode title="Home" description="Home" url="~/default.aspx">
        <siteMapNode title="Services" description="Services we offer" url="~/Services.aspx">
            <siteMapNode title="Consulting" description="Consulting services" url="~/Consulting.aspx" />
            <siteMapNode title="Support" description="Supports plans" url="~/Support.aspx" />
        </siteMapNode>
        <siteMapNode title="About Us" description="About Us" url="~/AboutUs.aspx">
            <siteMapNode title="Company" description="Our people and offices" url="~/Company.aspx" />
            <siteMapNode title="Blogs" description="Blogs from us to you"
              url="http://blogs.mysite.com/default.aspx" />
        </siteMapNode>
    </siteMapNode>
</siteMap>

So our basic menu will look like this: More...

Tags: , ,

Web Development | ASP.NET

RecentComments

Comment RSS