<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>-[ Danny Chen ]-  : VWD &amp;amp; ASP.NET</title><link>http://blogs.msdn.com/dannychen/archive/tags/VWD+_2600_amp_3B00_+ASP.NET/default.aspx</link><description>Tags: VWD &amp;amp; ASP.NET</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>A style that will make the entire cell "clickable" in a Menu</title><link>http://blogs.msdn.com/dannychen/archive/2006/04/27/585220.aspx</link><pubDate>Thu, 27 Apr 2006 20:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:585220</guid><dc:creator>dannychen</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/dannychen/comments/585220.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dannychen/commentrss.aspx?PostID=585220</wfw:commentRss><description>&lt;P&gt;Here's a quick tip for the Menu control.&amp;nbsp; I'm pretty sure there were some good reasons why this wasn't the default but I just can't think of them at the moment. [EDIT: I just remembered one of them, this won't work&amp;nbsp;perfectly&amp;nbsp;with ItemSpacing...]&lt;/P&gt;
&lt;P&gt;If you want to make the entire cell clickable (and not just the text), try using a style "display:block; width:100%".&amp;nbsp; You'll only want to apply this to the &amp;lt;A&amp;gt; inside the cells.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Here's an example:&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 9pt; FONT-FAMILY: monospace; BACKGROUND-COLOR: white"&gt;&amp;lt;%&lt;FONT color=blue&gt;@&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=maroon&gt;Page&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;Language&lt;/FONT&gt;&lt;FONT color=blue&gt;="C#"&lt;/FONT&gt;&lt;FONT color=black&gt; %&amp;gt;&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;!&lt;/FONT&gt;&lt;FONT color=maroon&gt;DOCTYPE&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;html&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;PUBLIC&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;"-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;BR&gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;html&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;xmlns&lt;/FONT&gt;&lt;FONT color=blue&gt;="http://www.w3.org/1999/xhtml"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;head&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;runat&lt;/FONT&gt;&lt;FONT color=blue&gt;="server"&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;title&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=black&gt;Untitled Page&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;title&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;style&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;type&lt;/FONT&gt;&lt;FONT color=blue&gt;="text/css"&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=maroon&gt;.smis&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=maroon&gt;a&lt;/FONT&gt;&lt;FONT color=black&gt; { &lt;/FONT&gt;&lt;FONT color=red&gt;width&lt;/FONT&gt;&lt;FONT color=black&gt;:&lt;/FONT&gt;&lt;FONT color=blue&gt;100%&lt;/FONT&gt;&lt;FONT color=black&gt;; &lt;/FONT&gt;&lt;FONT color=red&gt;display&lt;/FONT&gt;&lt;FONT color=black&gt;:&lt;/FONT&gt;&lt;FONT color=blue&gt;block&lt;/FONT&gt;&lt;FONT color=black&gt;; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;style&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;head&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;body&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;form&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;id&lt;/FONT&gt;&lt;FONT color=blue&gt;="form1"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;runat&lt;/FONT&gt;&lt;FONT color=blue&gt;="server"&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;div&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;asp&lt;/FONT&gt;&lt;FONT color=blue&gt;:&lt;/FONT&gt;&lt;FONT color=maroon&gt;Menu&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;ID&lt;/FONT&gt;&lt;FONT color=blue&gt;="Menu1"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;runat&lt;/FONT&gt;&lt;FONT color=blue&gt;="server"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;BackColor&lt;/FONT&gt;&lt;FONT color=blue&gt;="Green"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;Width&lt;/FONT&gt;&lt;FONT color=blue&gt;="200px"&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;Items&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;asp&lt;/FONT&gt;&lt;FONT color=blue&gt;:&lt;/FONT&gt;&lt;FONT color=maroon&gt;MenuItem&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;Text&lt;/FONT&gt;&lt;FONT color=blue&gt;="ItemA"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;Value&lt;/FONT&gt;&lt;FONT color=blue&gt;="A"&amp;gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;asp&lt;/FONT&gt;&lt;FONT color=blue&gt;:&lt;/FONT&gt;&lt;FONT color=maroon&gt;MenuItem&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;asp&lt;/FONT&gt;&lt;FONT color=blue&gt;:&lt;/FONT&gt;&lt;FONT color=maroon&gt;MenuItem&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;Text&lt;/FONT&gt;&lt;FONT color=blue&gt;="ItemB"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;Value&lt;/FONT&gt;&lt;FONT color=blue&gt;="B"&amp;gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;asp&lt;/FONT&gt;&lt;FONT color=blue&gt;:&lt;/FONT&gt;&lt;FONT color=maroon&gt;MenuItem&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;Items&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;StaticHoverStyle&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;BackColor&lt;/FONT&gt;&lt;FONT color=blue&gt;="#FF8080"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;/&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;StaticMenuItemStyle&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;CssClass&lt;/FONT&gt;&lt;FONT color=blue&gt;="smis"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;/&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;asp&lt;/FONT&gt;&lt;FONT color=blue&gt;:&lt;/FONT&gt;&lt;FONT color=maroon&gt;Menu&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;div&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;form&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;body&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;html&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;/FONT&gt; &lt;/DIV&gt;
&lt;DIV style="FONT-SIZE: 9pt; FONT-FAMILY: monospace; BACKGROUND-COLOR: white"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV style="FONT-SIZE: 9pt; FONT-FAMILY: monospace; BACKGROUND-COLOR: white"&gt;(ps. Thanks to &lt;A href="/petel"&gt;Pete&lt;/A&gt; for helping me figure this out)&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=585220" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dannychen/archive/tags/VWD+_2600_amp_3B00_+ASP.NET/default.aspx">VWD &amp;amp; ASP.NET</category></item><item><title>Source to the StaticSiteMapProvider and XmlSiteMapProvider (and others) availible for download.</title><link>http://blogs.msdn.com/dannychen/archive/2006/04/14/576449.aspx</link><pubDate>Fri, 14 Apr 2006 18:28:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:576449</guid><dc:creator>dannychen</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/dannychen/comments/576449.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dannychen/commentrss.aspx?PostID=576449</wfw:commentRss><description>&lt;P&gt;I might be more excited about this than I was about the Web Application Projects preview we just released...&lt;/P&gt;
&lt;P&gt;One of the last things I worked on in the ASP.NET&amp;nbsp;runtime test team was&amp;nbsp;validating a version of the sources of our providers so that users could download them and see first hand what our design practices are.&amp;nbsp; That work is finally availible to you.&lt;/P&gt;
&lt;P&gt;I spend a large portion of my blogging efforts and forum responses trying to promote good designs or revealing little snippets of how we implemented the StaticSiteMapProvider and the XmlSiteMapProvider.&amp;nbsp; Now, the sources for these providers are availible for download all ASP.NET users and&amp;nbsp;users can see examples of well written providers or copy the code to help bootstrap their own projects.&lt;/P&gt;
&lt;P&gt;Download here: &lt;A href="http://download.microsoft.com/download/a/b/3/ab3c284b-dc9a-473d-b7e3-33bacfcc8e98/ProviderToolkitSamples.msi"&gt;http://download.microsoft.com/download/a/b/3/ab3c284b-dc9a-473d-b7e3-33bacfcc8e98/ProviderToolkitSamples.msi&lt;/A&gt;&lt;BR&gt;More Info here: &lt;A href="http://msdn.microsoft.com/asp.net/downloads/providers/default.aspx"&gt;http://msdn.microsoft.com/asp.net/downloads/providers/default.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;One note: Functionally these providers are nearly equivelent to those actually in the framework, but because they occasionally used some internal APIs, we had to alter a few calls to use public methods instead as well as some other minor changes.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=576449" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dannychen/archive/tags/VWD+_2600_amp_3B00_+ASP.NET/default.aspx">VWD &amp;amp; ASP.NET</category></item><item><title>Web Application Projects RC1 is availible!!!!</title><link>http://blogs.msdn.com/dannychen/archive/2006/04/05/569390.aspx</link><pubDate>Thu, 06 Apr 2006 00:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:569390</guid><dc:creator>dannychen</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/dannychen/comments/569390.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dannychen/commentrss.aspx?PostID=569390</wfw:commentRss><description>&lt;P&gt;For the past few months, I've been primarily working on a new&amp;nbsp;feature called Web Application Projects.&amp;nbsp; This&amp;nbsp;was incredibly challenging and took way more of my time than I realized it would&amp;nbsp;but it&amp;nbsp;also quite exciting to work on.&amp;nbsp; So, I'm incredibly happy to finally announce that it is availible for download on msdn.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Web Application Projects is a feature we started working on immediately after we finished shipping Visual Studio 2005.&amp;nbsp; While the "website model" is great for new projects, there were a lot of challenges for migrating Visual Studio 2003 web projects to VS05.&amp;nbsp; We also&amp;nbsp;lost a few features between 03 and 05&amp;nbsp;such as being able to add class files where the logically fit in the site (ie in parallel with&amp;nbsp;pages that depended on them).&amp;nbsp; We solved these problems by creating this plug-in.&amp;nbsp; It,&amp;nbsp;in many ways,&amp;nbsp;brings back the VS03&amp;nbsp;web project model into VS05.&amp;nbsp;&amp;nbsp;Existing VS03 users should find it quite&amp;nbsp;easy to pick up.&lt;/P&gt;
&lt;P&gt;Rather than just&amp;nbsp;wait for SP1 to be put together and including it there, we decided to make "WAPs" availible early as a "speedboat" or plugin for Visual Studio 2005.&amp;nbsp;In the next few posts, I'll try and address some of the differences between websites and web apps.&amp;nbsp; But for now, here's a few links:&lt;/P&gt;
&lt;P&gt;You can download it here:&amp;nbsp; &lt;A href="http://msdn.microsoft.com/asp.net/reference/infrastructure/wap/default.aspx"&gt;http://msdn.microsoft.com/asp.net/reference/infrastructure/wap/default.aspx&lt;/A&gt;&lt;BR&gt;You will need to patch Visual Studio in order to install WAPs, all the details are on the site.&lt;/P&gt;
&lt;P&gt;There's a forum dedicated to WAPs here: &lt;A href="http://forums.asp.net/1019/ShowForum.aspx"&gt;http://forums.asp.net/1019/ShowForum.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Scott Guthrie also has a lot of information&amp;nbsp;about WAPs&amp;nbsp;on his blog and website:&lt;BR&gt;&lt;A href="http://weblogs.asp.net/scottgu/archive/2006/04/05/442032.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2006/04/05/442032.aspx&lt;/A&gt;&lt;BR&gt;&lt;A href="http://webproject.scottgu.com/"&gt;http://webproject.scottgu.com/&lt;/A&gt;&lt;BR&gt;&lt;A href="http://weblogs.asp.net/scottgu/archive/2005/12/16/433374.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2005/12/16/433374.aspx&lt;/A&gt;&lt;BR&gt;&lt;A href="http://weblogs.asp.net/scottgu/archive/2006/03/27/441147.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2006/03/27/441147.aspx&lt;/A&gt;&lt;BR&gt;&lt;A href="http://weblogs.asp.net/scottgu/archive/2006/02/05/437439.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2006/02/05/437439.aspx&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=569390" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dannychen/archive/tags/VWD+_2600_amp_3B00_+ASP.NET/default.aspx">VWD &amp;amp; ASP.NET</category></item><item><title>A brief history of MasterPages and templating web content (aka MasterPages are NOT frames)</title><link>http://blogs.msdn.com/dannychen/archive/2006/04/05/569316.aspx</link><pubDate>Wed, 05 Apr 2006 22:48:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:569316</guid><dc:creator>dannychen</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/dannychen/comments/569316.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dannychen/commentrss.aspx?PostID=569316</wfw:commentRss><description>&lt;P&gt;One question I see constantly on the forums is:&amp;nbsp; How do I get a Masterpage to load Content1 from one page but Content2 from another page or&amp;nbsp;How do I get&amp;nbsp;Content2 to reload when I click a button in Content1 without reloading the entire page.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The root of the question is often a misunderstanding of the concept of a Masterpage and confusing it with frames.&amp;nbsp; Masterpages are a way of templating a site.&amp;nbsp; By this I mean&amp;nbsp;defining a look and feel for the overall site and proving a central point for common code&amp;nbsp;while allowing individual pages to modify their specific&amp;nbsp;content.&amp;nbsp; This is not the same thing as a frame although frames are sometimes&amp;nbsp;used this way.&amp;nbsp; Instead, frames are a way of collaging multiple arbitrary pages together in a single browser.&amp;nbsp; Frames are also a &lt;A href="http://karlcore.com/articles/article.php?id=2"&gt;bad idea&lt;/A&gt;&amp;nbsp;[&lt;A href="http://www.karlcore.com/"&gt;www.karlcore.com&lt;/A&gt;].&lt;/P&gt;
&lt;P&gt;To begin with, I need to make the assumption that a consistent layout across various pages on a site is a good thing.&amp;nbsp; I hope this can be agreed on.&amp;nbsp; Secondly, duplication of code is a bad thing and hard to maintain.&amp;nbsp; I also hope that this can be agreed on.&amp;nbsp; The conclusion is that it would be good if the code that manages the look and feel of a site as well as the common components (such as a navigation system, header, and footer) was kept in as few and as specific as possible locations.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;To explain the&amp;nbsp;motivation for Masterpages and give a little more perspective on how they were designed, let me start with an older and little seen anymore concept that was used to solve this problem.&amp;nbsp; It is&amp;nbsp;called "Server Side Includes".&amp;nbsp; SSI was a&amp;nbsp;relatively light weight way that a server could merge together multiple files into a single output stream&amp;nbsp;to the client.&amp;nbsp; This was probably one of the first big steps into a web server actually&amp;nbsp;parsing content (rather than&amp;nbsp;just streaming it) and&amp;nbsp;it&amp;nbsp;looked something like this:&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 9pt; FONT-FAMILY: monospace; BACKGROUND-COLOR: white"&gt;&lt;FONT color=green&gt;&amp;lt;!--#include virtual="/header.html" --&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;td&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=black&gt;This is some content data here&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;td&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=green&gt;&amp;lt;!--#include virtual="/footer.html" --&amp;gt;&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;P&gt;Those aren't just html comments, they are also directives that the web server understands.&amp;nbsp; You can imagine that header.html and footer.html contained the html for a header and a footer.&amp;nbsp; Somewhere in there depending on the layout of the page was likely to be a navigation menu and perhaps copyright info, etc.&amp;nbsp; Well, this worked fine when it was 1998 but with new technology (like ASP) we wanted a bit more features.&amp;nbsp; For one thing, it would be nice of the header/footer could interact with the content and vice-versa.&amp;nbsp; So, the natural progression was to use UserControls like this:&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 9pt; FONT-FAMILY: monospace; BACKGROUND-COLOR: white"&gt;&amp;lt;%&lt;FONT color=blue&gt;@&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=maroon&gt;Register&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;Src&lt;/FONT&gt;&lt;FONT color=blue&gt;="header.ascx"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;TagName&lt;/FONT&gt;&lt;FONT color=blue&gt;="header"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;TagPrefix&lt;/FONT&gt;&lt;FONT color=blue&gt;="uc1"&lt;/FONT&gt;&lt;FONT color=black&gt; %&amp;gt;&lt;BR&gt;&amp;lt;%&lt;/FONT&gt;&lt;FONT color=blue&gt;@&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=maroon&gt;Register&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;Src&lt;/FONT&gt;&lt;FONT color=blue&gt;="footer.ascx"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;TagName&lt;/FONT&gt;&lt;FONT color=blue&gt;="footer"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;TagPrefix&lt;/FONT&gt;&lt;FONT color=blue&gt;="uc2"&lt;/FONT&gt;&lt;FONT color=black&gt; %&amp;gt;&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;uc1&lt;/FONT&gt;&lt;FONT color=blue&gt;:&lt;/FONT&gt;&lt;FONT color=maroon&gt;header&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;ID&lt;/FONT&gt;&lt;FONT color=blue&gt;="Header1"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;runat&lt;/FONT&gt;&lt;FONT color=blue&gt;="server"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;/&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;form&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;id&lt;/FONT&gt;&lt;FONT color=blue&gt;="form1"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;runat&lt;/FONT&gt;&lt;FONT color=blue&gt;="server"&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;div&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Some Content Here&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;div&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;form&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;uc2&lt;/FONT&gt;&lt;FONT color=blue&gt;:&lt;/FONT&gt;&lt;FONT color=maroon&gt;footer&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;ID&lt;/FONT&gt;&lt;FONT color=blue&gt;="Footer1"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;runat&lt;/FONT&gt;&lt;FONT color=blue&gt;="server"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;/&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;P&gt;Again, header markup was in header.ascx and footer markup was in footer.ascx pretty much like before.&amp;nbsp; Well, this was certainly much better than the SSIs we had before but there were still other nagging problems.&amp;nbsp; One big one was that you were almost certain to have&amp;nbsp;invalid XML/HTML code in the header/footer controls.&amp;nbsp; For example, the &amp;lt;html&amp;gt; tag&amp;nbsp;was likely to be opened in the header but closed in the footer leaving both files with&amp;nbsp;dangling tags.&amp;nbsp; The alternative was to bring a lot of layout code into the page which defeated the purpose of this whole arrangement.&lt;/P&gt;
&lt;P&gt;So, with Masterpages, we can address these issues (note: while I've demonstrated a problem we've solved, I don't mean to convey that this is the only problem we've tried to solve, there are certainly many others).&amp;nbsp; The Masterpage becomes the place where the layout of a site is created and where common components such as navigation can be placed.&amp;nbsp; The content pages, are exactly that, pages which contain content that is specific to the page.&amp;nbsp; And it looks something like this as most users are probably aware:&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 9pt; FONT-FAMILY: monospace; BACKGROUND-COLOR: white"&gt;Master Page:&lt;BR&gt;
&lt;DIV style="FONT-SIZE: 9pt; FONT-FAMILY: monospace; BACKGROUND-COLOR: white"&gt;&amp;lt;%&lt;FONT color=blue&gt;@&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=maroon&gt;Master&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;Language&lt;/FONT&gt;&lt;FONT color=blue&gt;="VB"&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=black&gt;%&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;html&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;xmlns&lt;/FONT&gt;&lt;FONT color=blue&gt;="http://www.w3.org/1999/xhtml"&amp;gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;head&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;runat&lt;/FONT&gt;&lt;FONT color=blue&gt;="server"&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;title&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=black&gt;Untitled Page&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;title&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;head&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;body&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;h1&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=black&gt;This is my Header&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;h1&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;form&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;id&lt;/FONT&gt;&lt;FONT color=blue&gt;="form1"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;runat&lt;/FONT&gt;&lt;FONT color=blue&gt;="server"&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;div&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;asp&lt;/FONT&gt;&lt;FONT color=blue&gt;:&lt;/FONT&gt;&lt;FONT color=maroon&gt;ContentPlaceHolder&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;ID&lt;/FONT&gt;&lt;FONT color=blue&gt;="ContentPlaceHolder1"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;runat&lt;/FONT&gt;&lt;FONT color=blue&gt;="server"&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=green&gt;&amp;lt;!-- the content will get filled in here --&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;asp&lt;/FONT&gt;&lt;FONT color=blue&gt;:&lt;/FONT&gt;&lt;FONT color=maroon&gt;ContentPlaceHolder&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;div&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;form&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;h2&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=black&gt;This is my Footer&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;h2&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;body&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;html&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=blue&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;Content Page:&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;%&lt;FONT color=blue&gt;@&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=maroon&gt;Page&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;Language&lt;/FONT&gt;&lt;FONT color=blue&gt;="VB"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;MasterPageFile&lt;/FONT&gt;&lt;FONT color=blue&gt;="~/MasterPage.master"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=black&gt;%&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;asp&lt;/FONT&gt;&lt;FONT color=blue&gt;:&lt;/FONT&gt;&lt;FONT color=maroon&gt;Content&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;ID&lt;/FONT&gt;&lt;FONT color=blue&gt;="Content1"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;ContentPlaceHolderID&lt;/FONT&gt;&lt;FONT color=blue&gt;="ContentPlaceHolder1"&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;Runat&lt;/FONT&gt;&lt;FONT color=blue&gt;="Server"&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;This is some content&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;asp&lt;/FONT&gt;&lt;FONT color=blue&gt;:&lt;/FONT&gt;&lt;FONT color=maroon&gt;Content&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;DIV style="FONT-SIZE: 9pt; FONT-FAMILY: monospace; BACKGROUND-COLOR: white"&gt;&lt;BR&gt;&lt;/DIV&gt;&lt;/FONT&gt;
&lt;P&gt;So, in summary, I hope that a reader who has made it this far will realize that Masterpages and content pages are &lt;STRONG&gt;not&lt;/STRONG&gt; frames.&amp;nbsp; Masterpages do not let you to mash many pages together in the browser.&amp;nbsp; They&amp;nbsp;better than that, they are a tool for designing a website with good design&amp;nbsp;practices and well formatted markup.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=569316" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dannychen/archive/tags/VWD+_2600_amp_3B00_+ASP.NET/default.aspx">VWD &amp;amp; ASP.NET</category></item><item><title>An overview of how securityTrimmingEnabled is supposed to work.</title><link>http://blogs.msdn.com/dannychen/archive/2006/03/16/553005.aspx</link><pubDate>Thu, 16 Mar 2006 19:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:553005</guid><dc:creator>dannychen</dc:creator><slash:comments>18</slash:comments><comments>http://blogs.msdn.com/dannychen/comments/553005.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dannychen/commentrss.aspx?PostID=553005</wfw:commentRss><description>&lt;P&gt;I think that the #1 most confusing or misunderstood portion of Site Navigation is the securityTrimmingEnabled flag and the roles attribute on siteMapNodes.&amp;nbsp; This post wil hopefuly clear up some of the confusion.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;SecurityTrimmingEnabled&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Firstly,&amp;nbsp;let&amp;nbsp;me&amp;nbsp;be&amp;nbsp;explicit about this: out of the box, securityTrimmingEnabled is meant to be a security feature.&lt;/P&gt;
&lt;P&gt;By secure, let me use the following definitions (hopefully we agree on them):&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;1) A page that should not be accessed by a user,&amp;nbsp;but can actually be accessed is &lt;STRONG&gt;not&lt;/STRONG&gt; secure.&amp;nbsp;&amp;nbsp;Even if the page is not linked to from any other page.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;2) A page that should not be accessed and cannot be accessed &lt;STRONG&gt;is&lt;/STRONG&gt; secure.&lt;/P&gt;
&lt;P&gt;Now, consider this in the context of a web.sitemap file.&amp;nbsp; Perhaps you have a rather simple file like this:&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 9pt; FONT-FAMILY: monospace; BACKGROUND-COLOR: white"&gt;&lt;FONT color=blue&gt;&amp;lt;?&lt;/FONT&gt;&lt;FONT color=maroon&gt;xml&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;version&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;1.0&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;encoding&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;UTF-8&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;?&amp;gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;siteMap&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;siteMapNode&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;url&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;home.aspx&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;title&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;Home Page - Everone can access this&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;siteMapNode&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;url&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;links.aspx&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;title&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;Links page - Anyone can access&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt; /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;siteMapNode&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;url&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;admin.aspx&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;title&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;Admin Page - Only the Admin can access&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt; /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;siteMapNode&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;siteMap&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;P&gt;Per our definitions, the admin page must be inaccessible, not just invisible to be secure.&amp;nbsp; Therefore, simply not showing the admin link in our Menu or TreeView isn't an adequate technique.&amp;nbsp; Instead, file ACLs must be set (for Windows auth) or &amp;lt;location&amp;gt; tags for Forms auth.&amp;nbsp; Here's what web.config might look like for Forms auth:&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 9pt; FONT-FAMILY: monospace; BACKGROUND-COLOR: white"&gt;&lt;FONT color=blue&gt;&amp;lt;?&lt;/FONT&gt;&lt;FONT color=maroon&gt;xml&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;version&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;1.0&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;?&amp;gt;&lt;BR&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;configuration&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;appSettings&lt;/FONT&gt;&lt;FONT color=blue&gt;/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;connectionStrings&lt;/FONT&gt;&lt;FONT color=blue&gt;/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;system.web&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;siteMap&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;defaultProvider&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;secureProvider&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;providers&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;add&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;name&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;secureProvider&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;type&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;System.Web.XmlSiteMapProvider&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=red&gt;siteMapFile&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;web.sitemap&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;securityTrimmingEnabled&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;true&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;providers&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;siteMap&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;system.web&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;location&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;path&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;~/admin.aspx&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;system.web&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;authorization&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;allow&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;roles&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;Admin&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;deny&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;users&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;*&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;authorization&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;system.web&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;location&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;configuration&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;P&gt;This, I would&amp;nbsp;consider secure.&amp;nbsp; Because of the &amp;lt;location&amp;gt; tag, only the Admin&amp;nbsp;role can access the admin.aspx page.&amp;nbsp; With securityTrimmingEnabled set to true, the navigation system will filter the admin.aspx&amp;nbsp;node out from the data returned if the user is not an Admin.&amp;nbsp; You'll note that filtering&amp;nbsp;was applied yet&amp;nbsp;nothing was modified in the actual web.sitemap file (this is often&amp;nbsp;the confusing part).&amp;nbsp; The filtering was directed by modifications to web.config and securing the site.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;The roles attribute on siteMapNodes.&lt;/U&gt;&lt;/STRONG&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;This attribute expands visibility to a particular node.&amp;nbsp; According to the previous section, a node is only visible if the user can access the node.&amp;nbsp; It is occasionally useful to show more nodes than would follow this rule.&amp;nbsp; Therefore, the SiteMapProvider additionally checks the roles attribute and, if the node wasn't already visible, will make it visible if the current user is in a role specified in the attribute.&amp;nbsp; There are two primary reasons this is useful:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;1) Nodes that don't have a url -- These nodes cannot be positively identified as accessible so they are considered inaccessible by the provider.&amp;nbsp; Therefore a role needs to be associated with them, often "*".&amp;nbsp; Ex:&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 9pt; FONT-FAMILY: monospace; BACKGROUND-COLOR: white"&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;siteMapNode&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;title&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;Child Pages&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;roles&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;*&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;!--&lt;/FONT&gt;&lt;FONT color=green&gt; child pages under here &lt;/FONT&gt;&lt;FONT color=blue&gt;--&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=maroon&gt;siteMapNode&lt;/FONT&gt;&lt;FONT color=blue&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;2) Common pages that require login that users would access -- Typically, by clicking on one of these links, the user will be redirected to a login page first.&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 9pt; FONT-FAMILY: monospace; BACKGROUND-COLOR: white"&gt;&lt;FONT color=blue&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;siteMapNode&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;url&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;membersOnly.aspx&lt;/FONT&gt;&lt;FONT color=black&gt;" &lt;FONT color=#ff0000&gt;title&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;Member Access Only&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=blue&gt; &lt;/FONT&gt;&lt;FONT color=red&gt;roles&lt;/FONT&gt;&lt;FONT color=blue&gt;=&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt;Users&lt;/FONT&gt;&lt;FONT color=black&gt;"&lt;/FONT&gt;&lt;FONT color=blue&gt; /&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;What else can you do?&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;Some users have reported that they don't actually care about the security aspect but really want the filtering ability.&amp;nbsp; A common request is to be able to filter based on the roles attribute&amp;nbsp;instead of expand based on roles.&amp;nbsp; These are fairly easy to do by extending the built in providers.&amp;nbsp; There is a single method to override.&amp;nbsp; Keep in mind that the roles collection on the&amp;nbsp;SiteMapNode refers to the roles that are specified in the web.sitemap file (or when the node was constructed):&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 9pt; FONT-FAMILY: monospace; BACKGROUND-COLOR: white"&gt;&lt;FONT color=blue&gt;Public&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;Class&lt;/FONT&gt;&lt;FONT color=black&gt; ExampleProvider&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;Inherits&lt;/FONT&gt;&lt;FONT color=black&gt; XmlSiteMapProvider&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;Public&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;Overrides&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;Function&lt;/FONT&gt;&lt;FONT color=black&gt; IsAccessibleToUser(&lt;/FONT&gt;&lt;FONT color=blue&gt;ByVal&lt;/FONT&gt;&lt;FONT color=black&gt; context &lt;/FONT&gt;&lt;FONT color=blue&gt;As&lt;/FONT&gt;&lt;FONT color=black&gt; System.Web.HttpContext, _&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=blue&gt;ByVal&lt;/FONT&gt;&lt;FONT color=black&gt; node &lt;/FONT&gt;&lt;FONT color=blue&gt;As&lt;/FONT&gt;&lt;FONT color=black&gt; System.Web.SiteMapNode) &lt;/FONT&gt;&lt;FONT color=blue&gt;As&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;Boolean&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=green&gt;' Write your custom logic here&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;End&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;Function&lt;BR&gt;&lt;BR&gt;End&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;Class&lt;/FONT&gt; &lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=553005" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dannychen/archive/tags/VWD+_2600_amp_3B00_+ASP.NET/default.aspx">VWD &amp;amp; ASP.NET</category></item><item><title>SiteMapProvider and spaces in querystrings</title><link>http://blogs.msdn.com/dannychen/archive/2006/03/08/545793.aspx</link><pubDate>Wed, 08 Mar 2006 03:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:545793</guid><dc:creator>dannychen</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/dannychen/comments/545793.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dannychen/commentrss.aspx?PostID=545793</wfw:commentRss><description>&lt;P&gt;A user found an interesting issue in the SiteMapProvider code.&amp;nbsp; It seems that if you have a node that has a url such as: "~/home.aspx?p=some text"&amp;nbsp; (notice the space in the query string) and you are actually navigated to that url, SiteMap.CurrentNode doesn't actually return the correct node.&amp;nbsp; The reason for this is that the url actually comes in as:&amp;nbsp; "/home.aspx?p=some%20text".&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Now, firstly, this &lt;STRONG&gt;is&lt;/STRONG&gt; a bug, and it's been filed to be addressed in the future&amp;nbsp;but what (if any)&amp;nbsp;is the workaround?&amp;nbsp; This one is tricky because the issue is pretty deep.&amp;nbsp; You need a custom provider and the appropriate method overridden.&amp;nbsp; When the user raised the issue, I thought about it and decided I could come up with the solution in 5 minutes or let him struggle with it for an hour.&amp;nbsp; What do you think I did?&lt;/P&gt;
&lt;P&gt;Here's the custom provider:&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 9pt; FONT-FAMILY: monospace; BACKGROUND-COLOR: white"&gt;&lt;FONT color=blue&gt;Public&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;Class&lt;/FONT&gt;&lt;FONT color=black&gt; testProvider : &lt;/FONT&gt;&lt;FONT color=blue&gt;Inherits&lt;/FONT&gt;&lt;FONT color=black&gt; XmlSiteMapProvider&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;Public&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;Overrides&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;Function&lt;/FONT&gt;&lt;FONT color=black&gt; FindSiteMapNode(&lt;/FONT&gt;&lt;FONT color=blue&gt;ByVal&lt;/FONT&gt;&lt;FONT color=black&gt; context &lt;/FONT&gt;&lt;FONT color=blue&gt;As&lt;/FONT&gt;&lt;FONT color=black&gt; System.Web.HttpContext) &lt;/FONT&gt;&lt;FONT color=blue&gt;As&lt;/FONT&gt;&lt;FONT color=black&gt; System.Web.SiteMapNode&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;Dim&lt;/FONT&gt;&lt;FONT color=black&gt; node &lt;/FONT&gt;&lt;FONT color=blue&gt;As&lt;/FONT&gt;&lt;FONT color=black&gt; SiteMapNode = &lt;/FONT&gt;&lt;FONT color=blue&gt;MyBase&lt;/FONT&gt;&lt;FONT color=black&gt;.FindSiteMapNode(context)&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;If&lt;/FONT&gt;&lt;FONT color=black&gt; node &lt;/FONT&gt;&lt;FONT color=blue&gt;Is&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;Nothing&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;Then&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;If&lt;/FONT&gt;&lt;FONT color=black&gt; context &lt;/FONT&gt;&lt;FONT color=blue&gt;Is&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;Nothing&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;Then&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;Return&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;Nothing&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;End&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;If&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;Dim&lt;/FONT&gt;&lt;FONT color=black&gt; queryString &lt;/FONT&gt;&lt;FONT color=blue&gt;As&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;String&lt;/FONT&gt;&lt;FONT color=black&gt; = &lt;/FONT&gt;&lt;FONT color=blue&gt;CType&lt;/FONT&gt;&lt;FONT color=black&gt;(context.CurrentHandler, Page).ClientQueryString&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;Dim&lt;/FONT&gt;&lt;FONT color=black&gt; pageUrl &lt;/FONT&gt;&lt;FONT color=blue&gt;As&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;String&lt;/FONT&gt;&lt;FONT color=black&gt; = HttpUtility.UrlDecode(context.Request.Path &amp;amp; &lt;/FONT&gt;&lt;FONT color=maroon&gt;"?"&lt;/FONT&gt;&lt;FONT color=black&gt; &amp;amp; queryString)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;node = &lt;/FONT&gt;&lt;FONT color=blue&gt;MyBase&lt;/FONT&gt;&lt;FONT color=black&gt;.FindSiteMapNode(pageUrl)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;End&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;If&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;Return&lt;/FONT&gt;&lt;FONT color=black&gt; node&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=blue&gt;End&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;Function&lt;BR&gt;&lt;BR&gt;End&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=blue&gt;Class&lt;BR&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=545793" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dannychen/archive/tags/VWD+_2600_amp_3B00_+ASP.NET/default.aspx">VWD &amp;amp; ASP.NET</category></item></channel></rss>