<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PeterKellner.net &#187; CSS Adapters</title>
	<atom:link href="http://peterkellner.net/category/css-adapters/feed/" rel="self" type="application/rss+xml" />
	<link>http://peterkellner.net</link>
	<description>Microsoft Focused, JavaScript,HTML5 (ExtJS, SenchaTouch &#38; Windows 8 Metro)</description>
	<lastBuildDate>Fri, 11 May 2012 16:43:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Multi Level ASP.NET Menu with CSS Friendly Control Adapters (The Source Code!) Part 6</title>
		<link>http://peterkellner.net/2009/03/27/codecampwebsiteseries6-cssfriendly-adapters-aspnet-menu/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=codecampwebsiteseries6-cssfriendly-adapters-aspnet-menu</link>
		<comments>http://peterkellner.net/2009/03/27/codecampwebsiteseries6-cssfriendly-adapters-aspnet-menu/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 19:40:23 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[ASP.NET 3.5]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Code Camp Web Site Series]]></category>
		<category><![CDATA[CSS Adapters]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2009/03/27/codecampwebsiteseries6-cssfriendly-adapters-aspnet-menu/</guid>
		<description><![CDATA[Article Series



Article 1:
Best Practices for Building an ASP.NET quality web site


Article 2:
Multi Level ASP.NET Menu with CSS Friendly Control Adapters


Article 3:
Creating a Theme For Each Year of Code Camp Using Skins in ASP.NET


Article 4:
Creating a Modal Login Window Using the Telerik Modal RadWindow Component


Article 5:
Using LINQ to Merge Mailing Lists and Filter Opt Outs


Article 6:
Multi [...]]]></description>
			<content:encoded><![CDATA[<h2>Article Series</h2>
<table border="0" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="100">Article 1:</td>
<td valign="top" width="600"><a href="http://peterkellner.net/2008/05/13/codecampwebsiteseries1/" target="_blank">Best Practices for Building an ASP.NET quality web site</a></td>
</tr>
<tr>
<td>Article 2:</td>
<td><a href="http://peterkellner.net/2008/05/19/codecampwebsiteseries2/">Multi Level ASP.NET Menu with CSS Friendly Control Adapters</a></td>
</tr>
<tr>
<td>Article 3:</td>
<td><a href="http://peterkellner.net/2008/05/25/codecampwebsiteseries3/">Creating a Theme For Each Year of Code Camp Using Skins in ASP.NET</a></td>
</tr>
<tr>
<td>Article 4:</td>
<td><a href="http://peterkellner.net/2008/06/29/sv-code-camp-web-site-series4/">Creating a Modal Login Window Using the Telerik Modal RadWindow Component</a></td>
</tr>
<tr>
<td>Article 5:</td>
<td><a href="http://peterkellner.net/2008/07/03/combine-email-lists-with-linq/">Using LINQ to Merge Mailing Lists and Filter Opt Outs</a></td>
</tr>
<tr>
<td>Article 6:</td>
<td><a href="http://peterkellner.net/2009/03/27/codecampwebsiteseries6-cssfriendly-adapters-aspnet-menu/">Multi Level ASP.NET Menu with CSS Friendly Control Adapters (The Source Code!)</a></td>
</tr>
</tbody>
</table>
<p> 
<p>I always intended to put the source code for this project online, however I just kept not getting around to it.&#160; In this article, I’m attaching a Visual Studio 2008 Solution that includes both the modified CSS Friendly Control Adapter as well as a sample application that demonstrates the technique in this series.&#160; I’m actually using the Code Camp CSS since that is the site that this solution was written for.&#160; I’ve created a much abbreviated version of the Code Camp Site Project for this demonstration.&#160; Below is the source code (finally).</p>
<p>Visual Studio 2008 Solution <a href="http://peterkellner.net/FilesForWebDownload/Mul.NETMenuwithCSSFriendlyControlAdapter_A90D/CSSFriendlyMenu.zip" target="_blank">CSSFriendlyCustomMenu</a></p>
<p>The solution is load out as follows:</p>
</p>
<p> <span id="more-275"></span>
</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/Mul.NETMenuwithCSSFriendlyControlAdapter_A90D/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/Mul.NETMenuwithCSSFriendlyControlAdapter_A90D/image_thumb.png" width="238" height="148" /></a></p>
<p>There are two projects (actually, one class library and a web site).&#160; The class library really is just the CSS Friendly Controls library with small modifications to the menu class.&#160; The WebSample web project is just a stripped down version of the code camp site to demonstrate the techniques used.&#160; When you run the web site, you should see results like the following.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/Mul.NETMenuwithCSSFriendlyControlAdapter_A90D/image_3.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/Mul.NETMenuwithCSSFriendlyControlAdapter_A90D/image_thumb_3.png" width="671" height="240" /></a></p>
<p>&#160;</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/Mul.NETMenuwithCSSFriendlyControlAdapter_A90D/image_4.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/Mul.NETMenuwithCSSFriendlyControlAdapter_A90D/image_thumb_4.png" width="676" height="239" /></a></p>
<p>Notice that when the speakers page is shown, the Program menu stays highlighted. </p>
<p>And, the sitemap is as follows:</p>
<div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
<div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">siteMap</span> <span style="color: #ff0000">xmlns</span><span style="color: #0000ff">=&quot;http://schemas.microsoft.com/AspNet/SiteMap-File-1.0&quot;</span> <span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   2:</span>   <span style="color: #0000ff">&lt;</span><span style="color: #800000">siteMapNode</span> <span style="color: #ff0000">url</span><span style="color: #0000ff">=&quot;Default.aspx&quot;</span> <span style="color: #ff0000">title</span><span style="color: #0000ff">=&quot;HOME&quot;</span>  <span style="color: #ff0000">description</span><span style="color: #0000ff">=&quot;Silicon Valley CodeCamp 08&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   3:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">siteMapNode</span> <span style="color: #ff0000">url</span><span style="color: #0000ff">=&quot;Register.aspx&quot;</span> <span style="color: #ff0000">title</span><span style="color: #0000ff">=&quot;REGISTER&quot;</span>  <span style="color: #ff0000">description</span><span style="color: #0000ff">=&quot;&quot;</span>  <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   4:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">siteMapNode</span> <span style="color: #ff0000">url</span><span style="color: #0000ff">=&quot;Program.aspx&quot;</span> <span style="color: #ff0000">title</span><span style="color: #0000ff">=&quot;PROGRAM&quot;</span>  <span style="color: #ff0000">description</span><span style="color: #0000ff">=&quot;&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   5:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">siteMapNode</span> <span style="color: #ff0000">url</span><span style="color: #0000ff">=&quot;SessionsOverview.aspx&quot;</span> <span style="color: #ff0000">title</span><span style="color: #0000ff">=&quot;Session Overview&quot;</span>  <span style="color: #ff0000">description</span><span style="color: #0000ff">=&quot;Session Overview&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   6:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">siteMapNode</span> <span style="color: #ff0000">url</span><span style="color: #0000ff">=&quot;Speakers.aspx&quot;</span> <span style="color: #ff0000">title</span><span style="color: #0000ff">=&quot;Speakers&quot;</span>  <span style="color: #ff0000">description</span><span style="color: #0000ff">=&quot;&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   7:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">siteMapNode</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   8:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">siteMapNode</span> <span style="color: #ff0000">url</span><span style="color: #0000ff">=&quot;News.aspx&quot;</span> <span style="color: #ff0000">title</span><span style="color: #0000ff">=&quot;NEWS&quot;</span>  <span style="color: #ff0000">description</span><span style="color: #0000ff">=&quot;&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">   9:</span>   <span style="color: #0000ff">&lt;/</span><span style="color: #800000">siteMapNode</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060">  10:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">siteMap</span><span style="color: #0000ff">&gt;</span></pre>
</p></div>
</div>
<p>That’s it!</p>
<p>Good luck with this.</p>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2009/03/27/codecampwebsiteseries6-cssfriendly-adapters-aspnet-menu/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Multi Level ASP.NET Menu with CSS Friendly Control AdaptersBuilding the New Code Camp Web Site (Part 2)</title>
		<link>http://peterkellner.net/2008/05/19/codecampwebsiteseries2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=codecampwebsiteseries2</link>
		<comments>http://peterkellner.net/2008/05/19/codecampwebsiteseries2/#comments</comments>
		<pubDate>Mon, 19 May 2008 22:38:46 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[ASP.NET 2.0]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Code Camp Web Site Series]]></category>
		<category><![CDATA[CSS Adapters]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2008/05/19/codecampwebsiteseries2/</guid>
		<description><![CDATA[<p>This article discusses the CSS Friendly Adapters and how they are integraged with the ASP.NET 2.0 menu control.  It shows the default html created by a sample menu control without the Friendly Adapters, as well as showing the html created using the Friendly Adapters.</p>]]></description>
			<content:encoded><![CDATA[<h2>Article Series</h2>
<blockquote>
<p><strong><em>(Source Code Available in Article 6 Below &#8211; (Added March 2009))</em></strong></p>
</blockquote>
<table border="0" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="100">Article 1:</td>
<td valign="top" width="600"><a href="http://peterkellner.net/2008/05/13/codecampwebsiteseries1/" target="_blank">Best Practices for Building an ASP.NET quality web site</a></td>
</tr>
<tr>
<td>Article 2:</td>
<td><a href="http://peterkellner.net/2008/05/19/codecampwebsiteseries2/">Multi Level ASP.NET Menu with CSS Friendly Control Adapters</a></td>
</tr>
<tr>
<td>Article 3:</td>
<td><a href="http://peterkellner.net/2008/05/25/codecampwebsiteseries3/">Creating a Theme For Each Year of Code Camp Using Skins in ASP.NET</a></td>
</tr>
<tr>
<td>Article 4:</td>
<td><a href="http://peterkellner.net/2008/06/29/sv-code-camp-web-site-series4/">Creating a Modal Login Window Using the Telerik Modal RadWindow Component</a></td>
</tr>
<tr>
<td>Article 5:</td>
<td><a href="http://peterkellner.net/2008/07/03/combine-email-lists-with-linq/">Using LINQ to Merge Mailing Lists and Filter Opt Outs</a></td>
</tr>
<tr>
<td>Article 6:</td>
<td><a href="http://peterkellner.net/2009/03/27/codecampwebsiteseries6-cssfriendly-adapters-aspnet-menu/">Multi Level ASP.NET Menu with CSS Friendly Control Adapters (The Source Code!)</a></td>
</tr>
</tbody>
</table>
<p></p>
<h2>Introduction</h2>
<div>
<div class="peterkellnerpromo">If you have complex styling issues involving ASP.NET we are experts and might be able to help.  This technique is fairly old however newer methods could be used for similar results. Contact Peter Kellner and his associates <a href="http://peterkellner.net/contactus">here</a>. </div>
<div>
<p>It&#8217;s often the case that brilliant designers will make interfaces that are hard to implement using standard frameworks like ASP.NET.&#160; As Software engineers striving for consistency, we always want to do the best we can with the standard tool kits to take advantage for built in functionality.&#160; <a href="http://asp.net/" target="_blank">ASP.NET 2.0&#8242;s</a> built in menu system is a perfect example.&#160; If you use that menu system, you get to make very simple declarative site maps by simply using the <a href="http://weblogs.asp.net/scottgu/archive/2005/11/20/431019.aspx">ASP.NET 2.0 Site Navigation Features.</a></p>
<p>The requirement faced today has to do with building the web site for our <a href="http://www.siliconvalley-codecamp.com/" target="_blank">third annual code camp</a>.&#160; We have that brilliant designer I mentioned above, and he has made a design that just seems too perfect to compromise.&#160; Here are some screen shots of how the designer envisions the sight looking and working after it is completed.</p>
</p></div>
<p><span id="more-112"></span></p>
<table border="0" cellspacing="0" cellpadding="2" width="800">
<tbody>
<tr>
<td valign="top" width="800">
          <br /><a href="http://peterkellner.net/wp/wp-content/uploads/2008/05/css1.jpg"><br />
            <br /><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="css1" src="http://peterkellner.net/wp/wp-content/uploads/2008/05/css1-thumb.jpg" width="740" height="133" /></a> </p>
<p></td>
</tr>
<tr>
<td valign="top" width="800">
          <br /><a href="http://peterkellner.net/wp/wp-content/uploads/2008/05/css2.jpg"><br />
            <br /><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="css2" src="http://peterkellner.net/wp/wp-content/uploads/2008/05/css2-thumb.jpg" width="741" height="121" /></a> </p>
<p></td>
</tr>
<tr>
<td valign="top" width="800">
          <br /><a href="http://peterkellner.net/wp/wp-content/uploads/2008/05/css3.jpg"><br />
            <br /><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="css3" src="http://peterkellner.net/wp/wp-content/uploads/2008/05/css3-thumb.jpg" width="740" height="136" /></a> </p>
<p></td>
</tr>
<tr>
<td valign="top" width="800">
          <br /><a href="http://peterkellner.net/wp/wp-content/uploads/2008/05/css4.jpg"><br />
            <br /><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="css4" src="http://peterkellner.net/wp/wp-content/uploads/2008/05/css4-thumb.jpg" width="741" height="124" /></a> </p>
<p></td>
</tr>
<tr>
<td valign="top" width="800">
          <br /><a href="http://peterkellner.net/wp/wp-content/uploads/2008/05/css5.jpg"><br />
            <br /><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="css5" src="http://peterkellner.net/wp/wp-content/uploads/2008/05/css5-thumb.jpg" width="748" height="134" /></a> </p>
<p></td>
</tr>
</tbody>
</table>
<p>Notice the interesting behavior of the top menu (REGISTER;PROGRAM;NEWS;ABOUT AND WIKI).&#160; Unselected, the bottom line strip is the same as selected.&#160; When selected, the background of the selection changes to a different shade of the same color as the bottom strip.</p>
<p>Also notice the interesting behavior of the secondary menu. that is, when ABOUT is selected from the top menu, notice that the secondary menu shows: Contact;Venue;Organizers;Sponsors and Previous.&#160; As you can see above (on the bottom of the 5 pictures), when Venu is selected, it is highlighted to in bright white to indicate that you have selected that.&#160; The really cool part here is that the ABOUT on the primary menu stays highlighted when you choose different&#160; secondary menu choices.</p>
<h2>Why Go Through The Trouble, why not just do it with HTML and CSS directly</h2>
<p>So, a reasonable person might say that since you can&#8217;t easily get this behavior with the asp:menu control and the site map provider (OK, at least I couldn&#8217;t figure it out), why not just code this up with simple list items, button clicks and a pile of code to react to those things?&#160; Well, the answer is you can certainly do that.&#160; The problem is the next time you want to do something similar you will find yourself doing a lot of cut and pasting.&#160; Personally, whenever I find myself cutting and pasting a lot I know I should probably think about how to refactor the code to make it more reusable and therefore more reliable.</p>
<h2>What Are the Benefits of Using asp:menu and the site map providers </h2>
<p>I mentioned that there are benefits to using the asp:menu and site map providers.&#160; What are those benefits you might ask.&#160; Well, let me first show you what you have to do to set up a simple menu system using these, then list the benefits of what comes out.</p>
<h3>The Web.SiteMap</h3>
<p>First, you need to create a web.sitemap file in your web directory.&#160; Here is what a simple one looks like similar to what will create the pictures above.</p>
<div class="csharpcode">
<pre class="alt"><span class="kwrd">&lt;?</span><span class="html">xml</span> <span class="attr">version</span><span class="kwrd">=&quot;1.0&quot;</span> <span class="attr">encoding</span><span class="kwrd">=&quot;utf-8&quot;</span> ?<span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>   <span class="kwrd">&lt;</span><span class="html">siteMap</span> <span class="attr">xmlns</span><span class="kwrd">=&quot;http://schemas.microsoft.com/AspNet/SiteMap-File-1.0&quot;</span> <span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">      <span class="kwrd">&lt;</span><span class="html">siteMapNode</span> <span class="attr">url</span><span class="kwrd">=&quot;Default.aspx&quot;</span> <span class="attr">title</span><span class="kwrd">=&quot;HOME&quot;</span> <span class="attr">description</span><span class="kwrd">=&quot;Silicon Valley CodeCamp 08&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>            <span class="kwrd">&lt;</span><span class="html">siteMapNode</span> <span class="attr">url</span><span class="kwrd">=&quot;Register.aspx&quot;</span> <span class="attr">title</span><span class="kwrd">=&quot;REGISTER&quot;</span>  <span class="attr">description</span><span class="kwrd">=&quot;&quot;</span> <span class="kwrd">/&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">            <span class="kwrd">&lt;</span><span class="html">siteMapNode</span> <span class="attr">url</span><span class="kwrd">=&quot;News.aspx&quot;</span> <span class="attr">title</span><span class="kwrd">=&quot;NEWS&quot;</span>  <span class="attr">description</span><span class="kwrd">=&quot;&quot;</span> <span class="kwrd">/&gt;</span></pre>
<p>&#160;</p>
<pre>            <span class="kwrd">&lt;</span><span class="html">siteMapNode</span> <span class="attr">url</span><span class="kwrd">=&quot;About.aspx&quot;</span> <span class="attr">title</span><span class="kwrd">=&quot;ABOUT&quot;</span>  <span class="attr">description</span><span class="kwrd">=&quot;&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">            <span class="kwrd">&lt;</span><span class="html">siteMapNode</span> <span class="attr">url</span><span class="kwrd">=&quot;Contact.aspx&quot;</span> <span class="attr">title</span><span class="kwrd">=&quot;Contact&quot;</span>  <span class="attr">description</span><span class="kwrd">=&quot;&quot;</span> <span class="kwrd">/&gt;</span></pre>
<p>&#160;</p>
<pre>            <span class="kwrd">&lt;</span><span class="html">siteMapNode</span> <span class="attr">url</span><span class="kwrd">=&quot;Sponsors.aspx&quot;</span> <span class="attr">title</span><span class="kwrd">=&quot;Sponsors&quot;</span>  <span class="attr">description</span><span class="kwrd">=&quot;&quot;</span> <span class="kwrd">/&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">            <span class="kwrd">&lt;</span><span class="html">siteMapNode</span> <span class="attr">url</span><span class="kwrd">=&quot;Previous.aspx&quot;</span> <span class="attr">title</span><span class="kwrd">=&quot;Previous&quot;</span>  <span class="attr">description</span><span class="kwrd">=&quot;&quot;</span> <span class="kwrd">/&gt;</span></pre>
<p>&#160;</p>
<pre>         <span class="kwrd">&lt;/</span><span class="html">siteMapNode</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">      <span class="kwrd">&lt;/</span><span class="html">siteMapNode</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>   <span class="kwrd">&lt;/</span><span class="html">siteMap</span><span class="kwrd">&gt;</span></pre>
</p></div>
<h3>The Web.Config </h3>
<p>You need to declare which sitemap provider you are using. In our case, we are simply reading from a file.&#160; Then, you should (do not have to) declare a section for each web page you want to provide role access to.&#160; Here is an example of my web.config. This first part says give access to any logged in user for Sponsors.aspx</p>
<div class="csharpcode">
<pre class="alt"><span class="kwrd">&lt;</span><span class="html">location</span> <span class="attr">path</span><span class="kwrd">=&quot;Sponsors.aspx&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>    <span class="kwrd">&lt;</span><span class="html">system.web</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">        <span class="kwrd">&lt;</span><span class="html">authorization</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>            <span class="kwrd">&lt;</span><span class="html">deny</span> <span class="attr">users</span><span class="kwrd">=&quot;?&quot;</span><span class="kwrd">/&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">        <span class="kwrd">&lt;/</span><span class="html">authorization</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>    <span class="kwrd">&lt;/</span><span class="html">system.web</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt"><span class="kwrd">&lt;/</span><span class="html">location</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre><span class="kwrd">&lt;/</span><span class="html">configuration</span><span class="kwrd">&gt;</span></pre>
</p></div>
<p>The Second part defines the Site Map Provider and sets securityTrimming to true to only show pages the user has access to.</p>
<div class="csharpcode">
<pre class="alt"><span class="kwrd">&lt;</span><span class="html">system.web</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>    <span class="kwrd">&lt;</span><span class="html">siteMap</span> <span class="attr">defaultProvider</span><span class="kwrd">=&quot;XmlSiteMapProvider&quot;</span> <span class="attr">enabled</span><span class="kwrd">=&quot;true&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">    <span class="kwrd">&lt;</span><span class="html">providers</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>        <span class="kwrd">&lt;</span><span class="html">add</span> <span class="attr">name</span><span class="kwrd">=&quot;XmlSiteMapProvider&quot;</span> </pre>
<p>&#160;</p>
<pre class="alt">        <span class="attr">description</span><span class="kwrd">=&quot;SiteMap provider which reads in .sitemap XML files.&quot;</span> </pre>
<p>&#160;</p>
<pre>        <span class="attr">type</span><span class="kwrd">=&quot;System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0,... </pre>
<p>&#160;</p>
<pre class="alt">        siteMapFile=&quot;</span><span class="attr">web</span>.<span class="attr">sitemap</span><span class="kwrd">&quot; securityTrimmingEnabled=&quot;</span><span class="attr">true</span>&quot;<span class="kwrd">/&gt;</span></pre>
<p>&#160;</p>
<pre>    <span class="kwrd">&lt;/</span><span class="html">providers</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">    <span class="kwrd">&lt;/</span><span class="html">siteMap</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>&#160;</pre>
</p></div>
<h3>The Master Page</h3>
<p>In your master page, you need to define your primary menu.&#160; In our case, it is the one that displays: REGISTER;NEWS and ABOUT.&#160; Here is all you need for that.</p>
<div class="csharpcode">
<pre class="alt">    <span class="kwrd">&lt;</span><span class="html">asp:Menu</span> <span class="attr">ID</span><span class="kwrd">=&quot;mainMenu&quot;</span> <span class="attr">runat</span><span class="kwrd">=&quot;server&quot;</span> <span class="attr">Orientation</span><span class="kwrd">=&quot;Horizontal&quot;</span> </pre>
<p>&#160;</p>
<pre>        <span class="attr">DataSourceID</span><span class="kwrd">=&quot;SiteMapMain&quot;</span> <span class="attr">CssClass</span><span class="kwrd">=&quot;headLinksBar&quot;</span>  <span class="attr">CssSelectorClass</span><span class="kwrd">=&quot;SimpleEntertainmentMenu&quot;</span></pre>
<p>&#160;</p>
<pre class="alt">        <span class="attr">MaximumDynamicDisplayLevels</span><span class="kwrd">=&quot;0&quot;</span> <span class="attr">StaticItemFormatString</span><span class="kwrd">=&quot;// {0} &amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>    <span class="kwrd">&lt;/</span><span class="html">asp:Menu</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt"><span class="kwrd">&lt;</span><span class="html">asp:SiteMapDataSource</span> <span class="attr">ID</span><span class="kwrd">=&quot;SiteMapMain&quot;</span> <span class="attr">runat</span><span class="kwrd">=&quot;server&quot;</span> <span class="attr">ShowStartingNode</span><span class="kwrd">=&quot;False&quot;</span> <span class="kwrd">/&gt;</span></pre>
</p></div>
<h3>The Inherited Page (About.aspx For Example)</h3>
<div class="csharpcode">
<pre class="alt"><span class="kwrd">&lt;</span><span class="html">asp:Content</span> <span class="attr">ID</span><span class="kwrd">=&quot;SublinksSessions&quot;</span> <span class="attr">ContentPlaceHolderID</span><span class="kwrd">=&quot;Sublinks&quot;</span> <span class="attr">runat</span><span class="kwrd">=&quot;server&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>    <span class="kwrd">&lt;</span><span class="html">asp:Menu</span> <span class="attr">ID</span><span class="kwrd">=&quot;subMenu&quot;</span> <span class="attr">runat</span><span class="kwrd">=&quot;server&quot;</span> <span class="attr">DataSourceID</span><span class="kwrd">=&quot;SiteMapAbout&quot;</span> <span class="attr">SkinID</span><span class="kwrd">=&quot;subMenu&quot;</span>  <span class="attr">CssClass</span><span class="kwrd">=&quot;headLinksBar&quot;</span> </pre>
<p>&#160;</p>
<pre class="alt">    <span class="attr">CssSelectorClass</span><span class="kwrd">=&quot;SimpleEntertainmentMenu&quot;</span>     <span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>    <span class="kwrd">&lt;/</span><span class="html">asp:Menu</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt"><span class="kwrd">&lt;/</span><span class="html">asp:Content</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>&#160;</pre>
</p></div>
<h3>And the Benefits&#8230;</h3>
<ul>
<li>You have no .net code to write! </li>
<li>Adding new menu items as Primary or Secondary is easy </li>
<li>Security is completely taken care of </li>
<li>Menu Entries Automatically come and go based on User Permission&#160; </li>
</ul>
<h2>Not Using the <a href="http://www.codeplex.com/cssfriendly" target="_blank"></p>
<p>CSS Friendly Adapters</p>
<p>    </a></h2>
<p>If you do not use the CSS Friendly Adapter library, the menu render using tables.&#160; <br />Below is what the actual HTML looks like of the main menu if I remove the</p>
<p><a href="http://www.codeplex.com/cssfriendly" target="_blank">CSS Friendly Adapters</a>.</p>
<div class="csharpcode">
<pre class="alt"><span class="kwrd">&lt;</span><span class="html">table</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>    <span class="kwrd">&lt;</span><span class="html">a</span> <span class="attr">href</span><span class="kwrd">=&quot;#ctl00_mainMenu_SkipLink&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">        <span class="kwrd">&lt;</span><span class="html">img</span> <span class="attr">alt</span><span class="kwrd">=&quot;Skip Navigation Links&quot;</span> <span class="attr">src</span><span class="kwrd">=&quot;/WebStyleOnly%20-%20Copy/WebResource.axd?d=G5&quot;</span> <span class="attr">width</span><span class="kwrd">=&quot;0&quot;</span> <span class="attr">height</span><span class="kwrd">=&quot;0&quot;</span> <span class="attr">style</span><span class="kwrd">=&quot;border-width: 0px;&quot;</span> <span class="kwrd">/&gt;</span></pre>
<p>&#160;</p>
<pre>    <span class="kwrd">&lt;/</span><span class="html">a</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">    <span class="kwrd">&lt;</span><span class="html">table</span> <span class="attr">id</span><span class="kwrd">=&quot;ctl00_mainMenu&quot;</span> <span class="attr">class</span><span class="kwrd">=&quot;headLinksBar ctl00_mainMenu_2&quot;</span> <span class="attr">cssselectorclass</span><span class="kwrd">=&quot;SimpleEntertainmentMenu&quot;</span> <span class="attr">cellpadding</span><span class="kwrd">=&quot;0&quot;</span> <span class="attr">cellspacing</span><span class="kwrd">=&quot;0&quot;</span> <span class="attr">border</span><span class="kwrd">=&quot;0&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>        <span class="kwrd">&lt;</span><span class="html">tr</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">            <span class="kwrd">&lt;</span><span class="html">td</span> <span class="attr">onmouseover</span><span class="kwrd">=&quot;Menu_HoverStatic(this)&quot;</span> <span class="attr">onmouseout</span><span class="kwrd">=&quot;Menu_Unhover(this)&quot;</span> <span class="attr">onkeyup</span><span class="kwrd">=&quot;Menu_Key(this)&quot;</span> <span class="attr">id</span><span class="kwrd">=&quot;ctl00_mainMenun0&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>                <span class="kwrd">&lt;</span><span class="html">table</span> <span class="attr">cellpadding</span><span class="kwrd">=&quot;0&quot;</span> <span class="attr">cellspacing</span><span class="kwrd">=&quot;0&quot;</span> <span class="attr">border</span><span class="kwrd">=&quot;0&quot;</span> <span class="attr">width</span><span class="kwrd">=&quot;100%&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">                    <span class="kwrd">&lt;</span><span class="html">tr</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>                        <span class="kwrd">&lt;</span><span class="html">td</span> <span class="attr">style</span><span class="kwrd">=&quot;white-space: nowrap;&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">                            <span class="kwrd">&lt;</span><span class="html">a</span> <span class="attr">class</span><span class="kwrd">=&quot;ctl00_mainMenu_1&quot;</span> <span class="attr">href</span><span class="kwrd">=&quot;/WebStyleOnly%20-%20Copy/Register.aspx&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>                                // REGISTER</pre>
<p>&#160;</p>
<pre class="alt">                            <span class="kwrd">&lt;/</span><span class="html">a</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>                        <span class="kwrd">&lt;/</span><span class="html">td</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">                    <span class="kwrd">&lt;/</span><span class="html">tr</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>                <span class="kwrd">&lt;/</span><span class="html">table</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">            <span class="kwrd">&lt;/</span><span class="html">td</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>            <span class="kwrd">&lt;</span><span class="html">td</span> <span class="attr">style</span><span class="kwrd">=&quot;width: 3px;&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">            <span class="kwrd">&lt;/</span><span class="html">td</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>            <span class="kwrd">&lt;</span><span class="html">td</span> <span class="attr">onmouseover</span><span class="kwrd">=&quot;Menu_HoverStatic(this)&quot;</span> <span class="attr">onmouseout</span><span class="kwrd">=&quot;Menu_Unhover(this)&quot;</span> <span class="attr">onkeyup</span><span class="kwrd">=&quot;Menu_Key(this)&quot;</span> <span class="attr">id</span><span class="kwrd">=&quot;ctl00_mainMenun1&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">                <span class="kwrd">&lt;</span><span class="html">table</span> <span class="attr">cellpadding</span><span class="kwrd">=&quot;0&quot;</span> <span class="attr">cellspacing</span><span class="kwrd">=&quot;0&quot;</span> <span class="attr">border</span><span class="kwrd">=&quot;0&quot;</span> <span class="attr">width</span><span class="kwrd">=&quot;100%&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>                <span class="kwrd">&lt;</span><span class="html">tr</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">                    <span class="kwrd">&lt;</span><span class="html">td</span> <span class="attr">style</span><span class="kwrd">=&quot;white-space: nowrap;&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>                        <span class="kwrd">&lt;</span><span class="html">a</span> <span class="attr">class</span><span class="kwrd">=&quot;ctl00_mainMenu_1&quot;</span> <span class="attr">href</span><span class="kwrd">=&quot;/WebStyleOnly%20-%20Copy/News.aspx&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">                            // NEWS </pre>
<p>&#160;</p>
<pre>                        <span class="kwrd">&lt;/</span><span class="html">a</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">                    <span class="kwrd">&lt;/</span><span class="html">td</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>                <span class="kwrd">&lt;/</span><span class="html">tr</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">                <span class="kwrd">&lt;/</span><span class="html">table</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>            <span class="kwrd">&lt;/</span><span class="html">td</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">            <span class="kwrd">&lt;</span><span class="html">td</span> <span class="attr">style</span><span class="kwrd">=&quot;width: 3px;&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>            <span class="kwrd">&lt;/</span><span class="html">td</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">            <span class="kwrd">&lt;</span><span class="html">td</span> <span class="attr">onmouseover</span><span class="kwrd">=&quot;Menu_HoverStatic(this)&quot;</span> <span class="attr">onmouseout</span><span class="kwrd">=&quot;Menu_Unhover(this)&quot;</span> <span class="attr">onkeyup</span><span class="kwrd">=&quot;Menu_Key(this)&quot;</span> <span class="attr">id</span><span class="kwrd">=&quot;ctl00_mainMenun2&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>                <span class="kwrd">&lt;</span><span class="html">table</span> <span class="attr">cellpadding</span><span class="kwrd">=&quot;0&quot;</span> <span class="attr">cellspacing</span><span class="kwrd">=&quot;0&quot;</span> <span class="attr">border</span><span class="kwrd">=&quot;0&quot;</span> <span class="attr">width</span><span class="kwrd">=&quot;100%&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">                    <span class="kwrd">&lt;</span><span class="html">tr</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>                        <span class="kwrd">&lt;</span><span class="html">td</span> <span class="attr">style</span><span class="kwrd">=&quot;white-space: nowrap;&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">                            <span class="kwrd">&lt;</span><span class="html">a</span> <span class="attr">class</span><span class="kwrd">=&quot;ctl00_mainMenu_1&quot;</span> <span class="attr">href</span><span class="kwrd">=&quot;/WebStyleOnly%20-%20Copy/About.aspx&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>                                // ABOUT</pre>
<p>&#160;</p>
<pre class="alt">                            <span class="kwrd">&lt;/</span><span class="html">a</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>                        <span class="kwrd">&lt;/</span><span class="html">td</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">                    <span class="kwrd">&lt;/</span><span class="html">tr</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>                <span class="kwrd">&lt;/</span><span class="html">table</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">            <span class="kwrd">&lt;/</span><span class="html">td</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>            <span class="kwrd">&lt;/</span><span class="html">span</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">        <span class="kwrd">&lt;/</span><span class="html">tr</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre><span class="kwrd">&lt;/</span><span class="html">table</span><span class="kwrd">&gt;</span></pre>
</p></div>
<p>The same code, when using the <a href="http://www.codeplex.com/cssfriendly" target="_blank">CSS Friendly adapters</a>, plus some clever additions that will be discussed later, has the html code looking like the following.</p>
<div class="csharpcode">
<pre class="alt"><span class="kwrd">&lt;</span><span class="html">table</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>    <span class="kwrd">&lt;</span><span class="html">tr</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">        <span class="kwrd">&lt;</span><span class="html">div</span> <span class="attr">class</span><span class="kwrd">=&quot;AspNet-Menu-Horizontal&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>            <span class="kwrd">&lt;</span><span class="html">ul</span> <span class="attr">class</span><span class="kwrd">=&quot;AspNet-Menu&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">                <span class="kwrd">&lt;</span><span class="html">li</span> <span class="attr">class</span><span class="kwrd">=&quot;AspNet-Menu-TopLevel-register&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>                    <span class="kwrd">&lt;</span><span class="html">a</span> <span class="attr">href</span><span class="kwrd">=&quot;/WebStyleOnly - Copy/Register.aspx&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">                      REGISTER</pre>
<p>&#160;</p>
<pre>                     <span class="kwrd">&lt;/</span><span class="html">a</span><span class="kwrd">&gt;</span> </pre>
<p>&#160;</p>
<pre class="alt">                <span class="kwrd">&lt;/</span><span class="html">li</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>                 <span class="kwrd">&lt;</span><span class="html">li</span> <span class="attr">class</span><span class="kwrd">=&quot;AspNet-Menu-TopLevel-news&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">                    <span class="kwrd">&lt;</span><span class="html">a</span> <span class="attr">href</span><span class="kwrd">=&quot;/WebStyleOnly - Copy/News.aspx&quot;</span><span class="kwrd">&gt;</span>NEWS<span class="kwrd">&lt;/</span><span class="html">a</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>                <span class="kwrd">&lt;/</span><span class="html">li</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">                <span class="kwrd">&lt;</span><span class="html">li</span> <span class="attr">class</span><span class="kwrd">=&quot;AspNet-Menu-TopLevel-about-Selected&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>                    <span class="kwrd">&lt;</span><span class="html">a</span> <span class="attr">href</span><span class="kwrd">=&quot;/WebStyleOnly - Copy/About.aspx&quot;</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">                      ABOUT<span class="kwrd">&lt;/</span><span class="html">a</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>                <span class="kwrd">&lt;/</span><span class="html">li</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">            <span class="kwrd">&lt;/</span><span class="html">ul</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre>         <span class="kwrd">&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre class="alt">     <span class="kwrd">&lt;/</span><span class="html">tr</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<pre> <span class="kwrd">&lt;/</span><span class="html">table</span><span class="kwrd">&gt;</span></pre>
</p></div>
<p>You can see that the CSS adapter code is not only much smaller, but easier to read and because of the inserted class names, much easier to customize.</p>
<h2>Conclusions</h2>
<p>We have not made clear yet how the CSS Friendly Adapters will make the menu&#8217;s work the way we want it to. We have shown css classes created (AspNet-Menu-TopLevel-about-Selected for example) are create by the custom code written by us in the CSS Friendly Adapter Project.&#160; We have however talked about the menu control and showed an example of how the html is actually rendered, and what is rendered based on.&#160; That is, the web.sitemap defines the menu and we have shown that.&#160; In the next article, we will show details of the custom code we have in the CSS Friendly Adapter that solves the problem of how to highlight the menu choices based on what is clicked.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2008/05/19/codecampwebsiteseries2/feed/</wfw:commentRss>
		<slash:comments>76</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 34/37 queries in 0.009 seconds using disk: basic
Content Delivery Network via Amazon Web Services: S3: PetersBlogCDN.s3.amazonaws.com

Served from: peterkellner.net @ 2012-05-22 09:58:27 -->
