a logical structure can be created in two easy steps:
<?xml version="1.0" encoding="utf-8" ?> <siteMap> <siteMapNode title="Home" url="default.aspx"> <siteMapNode title="Article 1" url="~/articles/demoarticle1.aspx" /> <siteMapNode title="Article 2" url="~/articles/demoarticle2.aspx" /> <siteMapNode title="Article 3" url="~/articles/demoarticle3.aspx" /> </siteMapNode> <siteMapNode title="Picture Gallery" url="~/PhotoAlbum/PhotoAlbums.aspx"> <siteMapNode title="Meetings" url="~/PhotoAlbum/PictureAlbum.aspx?albumid=1"/> <siteMapNode title="Activities" url="~/PhotoAlbum/PictureAlbum.aspx?albumid=2"/> <siteMapNode title="Training" url="~/PhotoAlbum/PictureAlbum.aspx?albumid=3"/> </siteMapNode> </siteMapNode></siteMap>
once the sitemapdatasource control is on a page, you can easily bind it to other controls such as the treeview control or the menu control.
<%@ page language="VB" master="~/Mysite.master" %> <asp:content id="Content1" contentplaceholderid="LeftSideContent"> <H2>Navigation </h2> <asp:treeview id="Navigation tree" runat="server" datasourceid="NavSource"/> </asp:content>
the tree view will display site navigation using a hierarchical view based on the definitions in the app.sitemap file.
asp.net 2.0 also introduces a set of navigation controls that can be used with the site navigation service. By using the <asp:treeview> or <asp:menu> controls, you can create a visual navigation structure for your application. The new <asp:sitemappath> control can be used to generate a "bread crumb trail" navigation structure.
figure 8. Bread crumb trail for the Home | Articles | Article 2 page
another new navigation-related feature in ASP.NET 2.0 is URL mapping. Web sites often require long, complicated, and convoluted URLs (think of an MSDN reference!). If you wanted to hide your URLs in a classical ASP application, you had to write a custom ISAPI handler to pre-process requests. ASP.NET 2.0 adds the URLMapping configuration section to the Web.config file. A developer can define a mapping that hides the real URL by mapping it to a more user friendly URL.
<urlMappings enabled="true"> <add url=