The star of the show will be the master page, but because it needs to have the
sitemap and the theme in place, well deal with these first.
Preparing the Sitemap
As we saw in Figure 5.1, on the left of every page of our Dorknozzle site will sit
a menu that contains links to the sites pages. Well implement that list using
the SiteMapPath control, which will require a sitemap file.
Adding Files to your Project
If the project is running in debug mode, you cant add new files to it, so you
must first stop debugging. You can do this by closing the browser window
(if youre using Internet Explorer), by selecting Debug > Stop Debugging,
or by clicking the Stop icon on the debug toolbar.
In Solution Explorer, right-click the root node and select Add New Item, as il-
lustrated in Figure 5.33.
Figure 5.33. Adding a new item to your project
187
Preparing the Sitemap
Figure 5.34. Adding a sitemap file
From the templates list, choose Site Map, as depicted in Figure 5.34 and leave
the filename as Web.sitemap.
Click Add to have the file created and added to your project. Youll be presented
with a default, empty sitemap that you can start modifying. Change its contents
as shown below. For now, you need only add a few nodes; you can add the rest
later on.
File: Web.sitemap
<?xml version="1.0" encoding="utf-8" ?>
<siteMap
xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="~/" title="Root" description="Root">
<siteMapNode url="~/Default.aspx" title="Home"
description="Dorknozzle Home" />
<siteMapNode url="~/HelpDesk.aspx" title="Help Desk"
description="Dorknozzle Help Desk" />
<siteMapNode url="~/EmployeeDirectory.aspx"
title="Employee Directory"
description="Dorknozzle Employee Directory" />
<siteMapNode url="~/AddressBook.aspx" title="Address Book"
description="Dorknozzle Address Book" />
188
Chapter 5: Building Web Applications

Get Build Your Own ASP.NET 2.0 Web Site Using C# & VB, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.