<?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>.Net Smoothie &#187; ASP.Net</title>
	<atom:link href="http://www.richardbushnell.net/tag/asp-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.richardbushnell.net</link>
	<description></description>
	<lastBuildDate>Thu, 12 Mar 2009 13:52:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>C# Acrobatics : Lambdas and Expression Methods as a replacement for NVelocity</title>
		<link>http://www.richardbushnell.net/2008/06/02/c-acrobatics-lambdas-and-expression-methods-as-a-replacement-for-nvelocity/</link>
		<comments>http://www.richardbushnell.net/2008/06/02/c-acrobatics-lambdas-and-expression-methods-as-a-replacement-for-nvelocity/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 10:09:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C# 3.0]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Extension Methods]]></category>
		<category><![CDATA[Lambda Expressions]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[ListView]]></category>
		<category><![CDATA[NVelocity]]></category>

		<guid isPermaLink="false">http://richardbushnell.net/index.php/2008/06/02/c-acrobatics-lambdas-and-expression-methods-as-a-replacement-for-nvelocity/</guid>
		<description><![CDATA[I&#8217;ve been very quiet recently. (I&#8217;m trying to not be so loud, Scott. ) You see, I&#8217;ve been writing a lot of ASP.Net code for a site I&#8217;m working on. And, to be honest, I&#8217;ve been having a lot of trouble. The source code for .Net has been very helpful, and I&#8217;ve learnt a lot [...]]]></description>
			<content:encoded><![CDATA[
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.richardbushnell.net%2F2008%2F06%2F02%2Fc-acrobatics-lambdas-and-expression-methods-as-a-replacement-for-nvelocity%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="false" style="border:none; overflow:; width:450px; height:30px"></iframe>
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<br><p>I&#8217;ve been very quiet recently. (I&#8217;m trying to not be so <a href="http://www.hanselman.com/blog/ProfessionalismProgrammingAndPunditryAndSuccessAsAMetric.aspx" target="_blank">loud</a>, Scott. <img src='http://www.richardbushnell.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) You see, I&#8217;ve been writing a lot of ASP.Net code for a site I&#8217;m working on. And, to be honest, I&#8217;ve been having a <em>lot</em> of trouble. The <a href="http://richardbushnell.net/index.php/2008/04/18/the-value-of-being-free-to-see-the-source/" target="_blank">source code for .Net</a> has been very helpful, and I&#8217;ve learnt a lot about what&#8217;s going on under the covers of ASP.Net because of it. </p>
<p>(Note: I won&#8217;t comment here on the quality of the code I&#8217;ve found &#8211; I&#8217;ll leave that up to you to judge. But in any case, I&#8217;ve been trying to build on top of it.)</p>
<p>One thing I&#8217;ve found to be important is the reliance on Web Controls. (It&#8217;s got something to do with javascript libraries, but that&#8217;s another story.) Getting away from the &quot;standard&quot; way to do ASP.Net isn&#8217;t easy though. Even the ninjas on the <a href="http://www.haacked.com/archive/2008/05/31/the-design-is-never-right-the-first-time.aspx" target="_blank">ASP.Net MVC</a> team <a href="http://www.haacked.com/archive/2008/05/03/code-based-repeater-for-asp.net-mvc.aspx" target="_blank">seem to be having trouble</a>. However, with the magic of lambdas and extension methods in C#, I think I might have just about managed to get something usable. I thought I&#8217;d publish my work here, and see what comments I got.</p>
<p>I think it&#8217;s best to start with what my ASP.Net code looks like once I&#8217;ve got everything working. (Notice I still have some Web Controls in there, but that&#8217;s because I&#8217;ve not worked out how to do sorting of data without web controls yet.)</p>
<p>The inspiration for this was taken from the <a href="r" target="_blank">improvements made to NVelocity</a> by the gurus on the Castle Project. I thought it looked great, and I&#8217;d like something similar, but I didn&#8217;t really want to learn a whole new scripting language and integrate it into my working environment just for rendering a bit of HTML. So I built some C# classes to do a similar thing for me instead. It&#8217;s not as nice as NVelocity, but it&#8217;s okay for now.</p>
<p><strong>Warning</strong>: The following code may contain statements of a disturbing nature to more sensitive readers. We cannot be held responsible for any confusion, delusion or mental illness caused by this code.</p>
<p>It starts by taking a collection of Task objects, and calling the extension method &quot;ForEach&quot; on them:</p>
<pre class="code"><span style="background: #ffee62">&lt;%</span> Tasks.ForEach(sections =&gt; {
   sections.NoData = tasks =&gt; {
<span style="background: #ffee62">%&gt;
</span><span style="color: blue">   &lt;</span><span style="color: #a31515">p</span><span style="color: blue">&gt;
</span>   Hey, you've got nothing to do.<span style="color: blue">&lt;/</span><span style="color: #a31515">p</span><span style="color: blue">&gt;
   &lt;</span><span style="color: #a31515">p</span><span style="color: blue">&gt;
</span><span style="background: #ffee62">&lt;%
</span>   };
   sections.BeforeAll = tasks =&gt; {
   <span style="background: #ffee62">%&gt;
</span>  <span style="color: blue">&lt;</span><span style="color: #a31515">table </span><span style="color: red">class</span><span style="color: blue">=&quot;task-list&quot;&gt;
    &lt;</span><span style="color: #a31515">tr </span><span style="color: red">class</span><span style="color: blue">=&quot;task-list-header&quot;&gt;
      &lt;</span><span style="color: #a31515">th</span><span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">LinkButton </span><span style="color: red">runat</span><span style="color: blue">=&quot;server&quot; </span><span style="color: red">CommandName</span><span style="color: blue">=&quot;Sort&quot; </span><span style="color: red">CommandArgument</span><span style="color: blue">=&quot;StartDate&quot;
          </span><span style="color: red">Text</span><span style="color: blue">=&quot;Started&quot; /&gt;
      &lt;/</span><span style="color: #a31515">th</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">th</span><span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">LinkButton </span><span style="color: red">runat</span><span style="color: blue">=&quot;server&quot; </span><span style="color: red">CommandName</span><span style="color: blue">=&quot;Sort&quot; </span><span style="color: red">CommandArgument</span><span style="color: blue">=&quot;DueOn&quot;
          </span><span style="color: red">Text</span><span style="color: blue">=&quot;Due&quot; /&gt;
      &lt;/</span><span style="color: #a31515">th</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">th</span><span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">LinkButton </span><span style="color: red">runat</span><span style="color: blue">=&quot;server&quot; </span><span style="color: red">CommandName</span><span style="color: blue">=&quot;Sort&quot; </span><span style="color: red">CommandArgument</span><span style="color: blue">=&quot;Priority&quot;
          </span><span style="color: red">Text</span><span style="color: blue">=&quot;Priority&quot; /&gt;
      &lt;/</span><span style="color: #a31515">th</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">th</span><span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">LinkButton </span><span style="color: red">CssClass</span><span style="color: blue">=&quot;task-description&quot; </span><span style="color: red">CommandName</span><span style="color: blue">=&quot;Sort&quot; </span><span style="color: red">CommandArgument</span><span style="color: blue">=&quot;Title&quot;
          </span><span style="color: red">Text</span><span style="color: blue">=&quot;Description&quot; </span><span style="color: red">runat</span><span style="color: blue">=&quot;server&quot; /&gt;
      &lt;/</span><span style="color: #a31515">th</span><span style="color: blue">&gt;</span><span style="color: blue">      &lt;</span><span style="color: #a31515">th</span><span style="color: blue">&gt;
      &lt;/</span><span style="color: #a31515">th</span><span style="color: blue">&gt;
    &lt;/</span><span style="color: #a31515">tr</span><span style="color: blue">&gt;
   </span><span style="background: #ffee62">&lt;%
</span>   };
     sections.Before = task =&gt; {
    <span style="background: #ffee62">%&gt;
</span>    <span style="color: blue">&lt;</span><span style="color: #a31515">tr </span><span style="color: red">class</span><span style="color: blue">=&quot;</span><span style="background: #ffee62">&lt;%</span>= this.tableCssClasses.Next() <span style="background: #ffee62">%&gt;</span><span style="color: blue">&quot;&gt;
    </span><span style="background: #ffee62">&lt;%
</span>   };
   sections.Each = task =&gt; {
    <span style="background: #ffee62">%&gt;</span>
    <span style="color: blue">&lt;</span><span style="color: #a31515">td</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">div </span><span style="color: red">class</span><span style="color: blue">='calendar calendar-icon-</span><span style="background: #ffee62">&lt;%</span>= task.StartMonth <span style="background: #ffee62">%&gt;</span><span style="color: blue">'&gt;
        &lt;</span><span style="color: #a31515">div </span><span style="color: red">class</span><span style="color: blue">=&quot;calendar-day&quot;&gt;
          </span><span style="background: #ffee62">&lt;%</span><span style="color: blue">= </span>task.StartDayOfMonth <span style="background: #ffee62">%&gt;</span><span style="color: blue">&lt;/</span><span style="color: #a31515">div</span><span style="color: blue">&gt;
      &lt;/</span><span style="color: #a31515">div</span><span style="color: blue">&gt;
    &lt;/</span><span style="color: #a31515">td</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">td</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">div </span><span style="color: red">class</span><span style="color: blue">='calendar calendar-icon-</span><span style="background: #ffee62">&lt;%</span>= task.DueMonth <span style="background: #ffee62">%&gt;</span><span style="color: blue">'&gt;
        &lt;</span><span style="color: #a31515">div </span><span style="color: red">class</span><span style="color: blue">=&quot;calendar-day&quot;&gt;
          </span><span style="background: #ffee62">&lt;%</span><span style="color: blue">= </span>task.DueDayOfMonth <span style="background: #ffee62">%&gt;</span><span style="color: blue">&lt;/</span><span style="color: #a31515">div</span><span style="color: blue">&gt;
      &lt;/</span><span style="color: #a31515">div</span><span style="color: blue">&gt;
    &lt;/</span><span style="color: #a31515">td</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">td</span><span style="color: blue">&gt;
      </span><span style="background: #ffee62">&lt;%</span><span style="color: blue">= </span>task.Priority <span style="background: #ffee62">%&gt;
</span>    <span style="color: blue">&lt;/</span><span style="color: #a31515">td</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">td </span><span style="color: red">class</span><span style="color: blue">=&quot;task-title&quot;&gt;
      &lt;</span><span style="color: #a31515">a </span><span style="color: red">href</span><span style="color: blue">='</span><span style="background: #ffee62">&lt;%</span>= Href.For(&quot;~/Tasks/{0}/Show.aspx&quot;, task.ID) <span style="background: #ffee62">%&gt;</span><span style="color: blue">'&gt;</span><span style="background: #ffee62">&lt;%</span><span style="color: blue">= </span>task.Title <span style="background: #ffee62">%&gt;</span><span style="color: blue">&lt;/</span><span style="color: #a31515">a</span><span style="color: blue">&gt;
    &lt;/</span><span style="color: #a31515">td</span><span style="color: blue">&gt;
</span><span style="color: blue">    &lt;</span><span style="color: #a31515">td</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">Button </span><span style="color: red">ID</span><span style="color: blue">=&quot;Button1&quot; </span><span style="color: red">runat</span><span style="color: blue">=&quot;server&quot; </span><span style="color: red">CssClass</span><span style="color: blue">=&quot;button&quot; </span><span style="color: red">CommandName</span><span style="color: blue">=&quot;Delete&quot; </span><span style="color: red">Text</span><span style="color: blue">=&quot;Mark Done&quot; /&gt;
    &lt;/</span><span style="color: #a31515">td</span><span style="color: blue">&gt;
    </span><span style="background: #ffee62">&lt;%
</span>   };

   sections.After = task =&gt; {
    <span style="background: #ffee62">%&gt;
</span>    <span style="color: blue">&lt;/</span><span style="color: #a31515">tr</span><span style="color: blue">&gt;
    </span><span style="background: #ffee62">&lt;%
</span>   };

   sections.AfterAll = task =&gt; {
    <span style="background: #ffee62">%&gt;
</span>    <span style="color: blue">&lt;/</span><span style="color: #a31515">table</span><span style="color: blue">&gt;
    </span><span style="background: #ffee62">&lt;%
</span>   };
 });
<span style="background: #ffee62">%&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>It might take a while to grasp what&#8217;s going on here. The code actually starts using an Extension method to IEnumerable that looks like this:</p>
<pre class="code"><span style="color: gray">public static void </span>ForEach&lt;T&gt;(<span style="color: gray">this </span><span style="color: #2b91af">IEnumerable</span>&lt;T&gt; enumerable, <span style="color: #2b91af">ForeachSectionSetter</span>&lt;T&gt; sectionSetter) {
  <span style="color: gray">if </span>(enumerable != <span style="color: gray">null</span>) {

    <span style="color: gray">if </span>(sectionSetter != <span style="color: gray">null</span>) {
      <span style="color: #2b91af">ForeachSections</span>&lt;T&gt; sections = <span style="color: gray">new </span><span style="color: #2b91af">ForeachSections</span>&lt;T&gt;();
      sectionSetter(sections);

      <span style="color: gray">if </span>(enumerable.Count() == 0) {
        <span style="color: gray">if </span>(sections.NoData != <span style="color: gray">null</span>)
          sections.NoData(enumerable);
        <span style="color: gray">return</span>;
      }

      <span style="color: gray">if </span>(sections.BeforeAll != <span style="color: gray">null</span>)
        sections.BeforeAll(enumerable);

      <span style="color: gray">int </span>itemIndex = 0;
      T previousItem = <span style="color: gray">default</span>(T);

      <span style="color: gray">foreach </span>(T item <span style="color: gray">in </span>enumerable) {
        <span style="color: gray">if </span>(sections.Before != <span style="color: gray">null</span>)
          sections.Before(item);
        <span style="color: gray">if </span>(itemIndex % 2 == 1 &amp;&amp; sections.Odd != <span style="color: gray">null</span>)
          sections.Odd(item);
        <span style="color: gray">if </span>(itemIndex % 2 == 0 &amp;&amp; sections.Even != <span style="color: gray">null</span>)
          sections.Even(item);
        <span style="color: gray">if </span>(itemIndex &gt; 0 &amp;&amp; sections.Between != <span style="color: gray">null</span>)
          sections.Between(previousItem, item);
        <span style="color: gray">if </span>(sections.Each != <span style="color: gray">null</span>)
          sections.Each(item);
        <span style="color: gray">if </span>(sections.After != <span style="color: gray">null</span>)
          sections.After(item);
        itemIndex++;
        previousItem = item;
      }
      <span style="color: gray">if </span>(sections.AfterAll != <span style="color: gray">null</span>)
        sections.AfterAll(enumerable);
    }
  }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>The delegate ForEachSectionSetter is used by the calling method with a lambda expression. As a parameter it receives an ForeachSections object, which looks like this:</p>
<pre class="code"><span style="color: gray">public class </span><span style="color: #2b91af">ForeachSections</span>&lt;T&gt; {
  <span style="color: gray">public </span><span style="color: #2b91af">Action</span>&lt;T&gt; Each { <span style="color: gray">get</span>; <span style="color: gray">set</span>; }
  <span style="color: gray">public </span><span style="color: #2b91af">Action</span>&lt;<span style="color: #2b91af">IEnumerable</span>&lt;T&gt;&gt; BeforeAll { <span style="color: gray">get</span>; <span style="color: gray">set</span>; }
  <span style="color: gray">public </span><span style="color: #2b91af">Action</span>&lt;T&gt; Before { <span style="color: gray">get</span>; <span style="color: gray">set</span>; }
  <span style="color: gray">public </span><span style="color: #2b91af">Action</span>&lt;T,T&gt; Between { <span style="color: gray">get</span>; <span style="color: gray">set</span>; }
  <span style="color: gray">public </span><span style="color: #2b91af">Action</span>&lt;T&gt; Odd { <span style="color: gray">get</span>; <span style="color: gray">set</span>; }
  <span style="color: gray">public </span><span style="color: #2b91af">Action</span>&lt;T&gt; Even { <span style="color: gray">get</span>; <span style="color: gray">set</span>; }
  <span style="color: gray">public </span><span style="color: #2b91af">Action</span>&lt;T&gt; After { <span style="color: gray">get</span>; <span style="color: gray">set</span>; }
  <span style="color: gray">public </span><span style="color: #2b91af">Action</span>&lt;<span style="color: #2b91af">IEnumerable</span>&lt;T&gt;&gt; AfterAll { <span style="color: gray">get</span>; <span style="color: gray">set</span>; }
  <span style="color: gray">public </span><span style="color: #2b91af">Action</span>&lt;<span style="color: #2b91af">IEnumerable</span>&lt;T&gt;&gt; NoData { <span style="color: gray">get</span>; <span style="color: gray">set</span>; }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>The calling method gets the chance to set the properties of this class before it is returned to the constructor of the ForEach method for processing. And because each property is already preset to a default value (Null in this case), the constructor can use the ForeachSections object just like a set of default or optional parameters. The caller can simply set values to the properties it needs, and ignore the rest.</p>
<p>If I had tried this another way, using overloadable constructors, it would have led to multiple constructors with indistinguishable signatures. If I&#8217;d have used property initializers, I wouldn&#8217;t have been able to run the whole routine without requiring a second call to the object, which actually wasn&#8217;t possible. </p>
<p>Basically, I couldn&#8217;t think of another way to do it. </p>
<p>The properties of the ForeachSections object are all delegates too. That means that we can use them with lambdas, which gives us lambdas inside of a lambda. (Hmm, very confusing!)</p>
<p>So what do you think? Could <em>you</em> use something like this? Can you make it simpler? Leave me a comment if you can.</p>

<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.richardbushnell.net%2F2008%2F06%2F02%2Fc-acrobatics-lambdas-and-expression-methods-as-a-replacement-for-nvelocity%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="false" style="border:none; overflow:; width:450px; height:30px"></iframe>
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
]]></content:encoded>
			<wfw:commentRss>http://www.richardbushnell.net/2008/06/02/c-acrobatics-lambdas-and-expression-methods-as-a-replacement-for-nvelocity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Value of Being Free to See the Source</title>
		<link>http://www.richardbushnell.net/2008/04/18/the-value-of-being-free-to-see-the-source/</link>
		<comments>http://www.richardbushnell.net/2008/04/18/the-value-of-being-free-to-see-the-source/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 14:09:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[exceptions]]></category>

		<guid isPermaLink="false">http://richardbushnell.net/index.php/2008/04/18/the-value-of-being-free-to-see-the-source/</guid>
		<description><![CDATA[Since the source code to ASP.Net was made available, I&#8217;ve been using it extensively. Here&#8217;s a great example of why it&#8217;s so valuable. I&#8217;ve been trying to integrate the Enterprise Library 3.1 Exception Handling Block into my application. My application is split into a core and web UI specific components, so I&#8217;ve defined errors in [...]]]></description>
			<content:encoded><![CDATA[
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.richardbushnell.net%2F2008%2F04%2F18%2Fthe-value-of-being-free-to-see-the-source%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="false" style="border:none; overflow:; width:450px; height:30px"></iframe>
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<br><p>Since the <a href="http://richardbushnell.net/index.php/2008/01/17/net-source-code-now-available/">source code to ASP.Net was made available</a>, I&#8217;ve been using it extensively. Here&#8217;s a great example of why it&#8217;s so valuable.</p>
<p>I&#8217;ve been trying to integrate the Enterprise Library 3.1 Exception Handling Block into my application. My application is split into a core and web UI specific components, so I&#8217;ve defined errors in my code to be thrown when a resource is not available. The web application configuration file specifies that if a specific exception, e.g. a ResourceNotFoundException, is thrown, the Exception Handling Block should replace that exception with a 404 Resource Not Found error using Http. That should in turn use the CustomErrors feature to redirect to a 404 not found page.</p>
<p>Makes sense, and sounds simple, don&#8217;t you think? </p>
<p>Nothing in the docs says that it shouldn&#8217;t work.</p>
<p><em>But it doesn&#8217;t</em>. It simply <em>won&#8217;t work</em>. Why? Well, there&#8217;s nothing on the web. But after spending some serious hours digging through the source code, I can finally see why.</p>
<p>Here&#8217;s a lovely little hidden-to-the-world snippet of the code I got inside of Visual Studio:</p>
<pre class="code">code = HttpException.GetHttpCodeForException(e);

<span style="color: green">// Don't raise event for 404.  See VSWhidbey 124147.
</span><span style="color: blue">if </span>(code != 404) {
  WebBaseEvent.RaiseRuntimeError(e, <span style="color: blue">this</span>);
}</pre>
<p><a href="http://11011.net/software/vspaste"></a>So it would never work! </p>
<p>Nice of them to let me know.</p>

<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.richardbushnell.net%2F2008%2F04%2F18%2Fthe-value-of-being-free-to-see-the-source%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="false" style="border:none; overflow:; width:450px; height:30px"></iframe>
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
]]></content:encoded>
			<wfw:commentRss>http://www.richardbushnell.net/2008/04/18/the-value-of-being-free-to-see-the-source/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Pure ASP.Net Grid with Grouping</title>
		<link>http://www.richardbushnell.net/2008/03/02/a-pure-aspnet-grid-with-grouping/</link>
		<comments>http://www.richardbushnell.net/2008/03/02/a-pure-aspnet-grid-with-grouping/#comments</comments>
		<pubDate>Sun, 02 Mar 2008 19:26:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Grouping]]></category>
		<category><![CDATA[LINQ to SQL]]></category>
		<category><![CDATA[LinqDataSource]]></category>
		<category><![CDATA[ListView]]></category>

		<guid isPermaLink="false">http://richardbushnell.net/index.php/2008/03/02/a-pure-aspnet-grid-with-grouping/</guid>
		<description><![CDATA[One of my favorite bloggers is Matt Berseth. Nearly once a week he comes up with a post where he does something amazing with the standard ASP.Net controls. I usually read his posts in awe. He&#8217;s really good. But he&#8217;s not only is a good developer, he&#8217;s a great writer. Even though his posts are [...]]]></description>
			<content:encoded><![CDATA[
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.richardbushnell.net%2F2008%2F03%2F02%2Fa-pure-aspnet-grid-with-grouping%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="false" style="border:none; overflow:; width:450px; height:30px"></iframe>
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<br><p>One of my favorite bloggers is <a href="http://mattberseth.com/blog">Matt Berseth</a>. Nearly once a week he comes up with a post where he does something amazing with the standard ASP.Net controls. I usually read his posts in awe. He&#8217;s really good.</p>
<p>But he&#8217;s not only is a good developer, he&#8217;s a great writer. Even though his posts are concise and straight to the point, most of them are pages long. You can really learn a lot from following his instructions.</p>
<p>He&#8217;s so good, in fact, that he regularly gets a mention on Scott Guthrie&#8217;s posts.</p>
<p>One of my favorite posts of his was where he used LINQ-to-SQL, a LinqDataSource control, and an ASP.Net ListView control &#8211; all new in .Net 3.5 &#8211; and made a grid with grouping functionality. He did it all in a standard way, and didn&#8217;t use any funny tricks.</p>
<p><a href="http://mattberseth.com/blog/2008/01/building_a_grouping_grid_with.html"><img style="border-right: 0px; border-top: 0px; margin: 0px; border-left: 0px; border-bottom: 0px" height="350" alt="image" src="http://www.richardbushnell.net/wp-content/uploads/2008/03/image1.png" width="465" border="0" /></a> </p>
<p>Here&#8217;s a link to the article:</p>
<h5><a href="http://mattberseth.com/blog/2008/01/building_a_grouping_grid_with.html">Building a Grouping Grid with the ASP.NET 3.5 LinqDataSource and ListView Controls</a></h5>
<p>Enjoy!</p>

<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.richardbushnell.net%2F2008%2F03%2F02%2Fa-pure-aspnet-grid-with-grouping%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="false" style="border:none; overflow:; width:450px; height:30px"></iframe>
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
]]></content:encoded>
			<wfw:commentRss>http://www.richardbushnell.net/2008/03/02/a-pure-aspnet-grid-with-grouping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Start Learning Silverlight 2.0 Now</title>
		<link>http://www.richardbushnell.net/2008/02/22/start-learning-silverlight-20-now/</link>
		<comments>http://www.richardbushnell.net/2008/02/22/start-learning-silverlight-20-now/#comments</comments>
		<pubDate>Fri, 22 Feb 2008 18:13:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight 2.0]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://richardbushnell.net/index.php/2008/02/22/start-learning-silverlight-20-now/</guid>
		<description><![CDATA[Now this is exciting. (Well, if you&#8217;re a geek.) Silverlight 2.0 is on its way, and Scott Guthrie has posted 8 tutorials about using it. I&#8217;m off to read them now&#8230;]]></description>
			<content:encoded><![CDATA[
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.richardbushnell.net%2F2008%2F02%2F22%2Fstart-learning-silverlight-20-now%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="false" style="border:none; overflow:; width:450px; height:30px"></iframe>
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<br><p>Now <a href="http://weblogs.asp.net/scottgu/archive/2008/02/22/first-look-at-silverlight-2.aspx" target="_blank">this</a> is exciting. (Well, if you&#8217;re a geek.)</p>
<p>Silverlight 2.0 is on its way, and Scott Guthrie has posted <a href="http://weblogs.asp.net/scottgu/archive/2008/02/22/first-look-at-silverlight-2.aspx" target="_blank">8 tutorials</a> about using it.</p>
<p>I&#8217;m off to read them now&#8230;</p>

<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.richardbushnell.net%2F2008%2F02%2F22%2Fstart-learning-silverlight-20-now%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="false" style="border:none; overflow:; width:450px; height:30px"></iframe>
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
]]></content:encoded>
			<wfw:commentRss>http://www.richardbushnell.net/2008/02/22/start-learning-silverlight-20-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My own ASP.Net MVP Framework</title>
		<link>http://www.richardbushnell.net/2008/02/03/my-own-aspnet-mvp-framework/</link>
		<comments>http://www.richardbushnell.net/2008/02/03/my-own-aspnet-mvp-framework/#comments</comments>
		<pubDate>Sun, 03 Feb 2008 13:59:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[MVP]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[framework]]></category>

		<guid isPermaLink="false">http://richardbushnell.net/index.php/2008/02/03/my-own-aspnet-mvp-framework/</guid>
		<description><![CDATA[So, I did it! I finally did it! I wanted to publish my ideas for a framework, and I did. You can find it on CodePlex at http://www.codeplex.com/aspnetmvp. Go have a look. I really want to know what you think. Now, I know there are a million and one frameworks for the web, so I [...]]]></description>
			<content:encoded><![CDATA[
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.richardbushnell.net%2F2008%2F02%2F03%2Fmy-own-aspnet-mvp-framework%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="false" style="border:none; overflow:; width:450px; height:30px"></iframe>
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<br><p>So, I did it! I finally did it!</p>
<p>I wanted to publish my ideas for a framework, and I did. You can find it on CodePlex at <a href="http://www.codeplex.com/aspnetmvp">http://www.codeplex.com/aspnetmvp</a>.</p>
<p>Go have a look. I really want to know what you think.</p>
<p><span id="more-44"></span></p>
<p>Now, I know there are a million and one frameworks for the web, so I don&#8217;t intend on trying to make anything  big out of this. But I also know that my customers, usually decent developers with basic ASP.Net knowledge, are constantly asking me for guidance for creating ASP.Net projects. To avoid repeating myself over and over, this project gives them a good starting point. When something better comes along, I can point them to that instead.</p>
<p>I can also use the project as a place for creating new ideas, like</p>
<ul>
<li>WF integration and reusable workflows, like shopping carts or the &#8220;hub and spoke UI pattern&#8221;.</li>
<li>plug-ins and skins, like Dotnetnuke</li>
</ul>
<p>I definitely do not want to reinvent the wheel. But I believe that there are currently loads of great ideas which could be used in a framework, but just require a little bit of effort to make them simple to use (e.g. UrlRewriting). Most of the developers I know want those extra features without having to spend a lot of time learning a new technology. This framework should be for them.</p>
<p>Instead of totally turning the heads of such developers around, asking them to use a completely new system (e.g. the ASP.Net MVC framework), this framework is meant to provide helpful stuff without stopping you from doing things the way you want (favicons and robots.txt files, for example). It gives you guidance on where to put your CSS files, master pages, scripts, and images. It also provides a way to do testing and project management in a sensible and flexible way. It uses the MVP pattern, but that isn&#8217;t mandatory. You can still write code in webforms if you really want to, and then you can refactor them out quite easily later.</p>
<p>I based my MVP implementation on some of the code from the Microsoft Patterns and Practices Web Client Software Factory. However, they made extensive use of the ObjectBuilder and attributes, which I found to be overengineering and too complex. So, as an alternative, I recreated the ideas using generics. I found it works well, and doesn&#8217;t have the performance overhead or the learning curve required with WCS.</p>
<p>The code currently uses the AdventureWorks Database, which you will need to install first before using the code. You can find the database on CodePlex here.</p>
<p>I&#8217;m currently working on another top-secret project, so I won&#8217;t really be spending much time on this. If you&#8217;re interested in discussing ideas or doing something with the project, let me know. I&#8217;d love to hear what you have to offer.</p>
<p>Otherwise, head on over to the <a href="http://www.codeplex.com/aspnetmvp">ASP.Net MVP Framework site</a>, and check out the code.</p>
<p>Oh, and until the lawyers call and ask me to change the name, let&#8217;s just leave it as it is.</p>
<p>P.S. I forgot to mention a &#8220;feature&#8221;. The Yahoo UI Framework has some great stuff for CSS, including grid layouts and css reset files. I integrated that too. I put it in the default theme. It means you don&#8217;t have to do much work to get your stylesheets to lay out your webpages well.</p>
<p>More to come on that later.</p>

<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.richardbushnell.net%2F2008%2F02%2F03%2Fmy-own-aspnet-mvp-framework%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="false" style="border:none; overflow:; width:450px; height:30px"></iframe>
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
]]></content:encoded>
			<wfw:commentRss>http://www.richardbushnell.net/2008/02/03/my-own-aspnet-mvp-framework/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>ASP.Net MVC Corollary &#8211; What to do?</title>
		<link>http://www.richardbushnell.net/2008/01/28/aspnet-mvc-corollary-what-to-do/</link>
		<comments>http://www.richardbushnell.net/2008/01/28/aspnet-mvc-corollary-what-to-do/#comments</comments>
		<pubDate>Mon, 28 Jan 2008 03:50:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Refactoring]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[SubSonic]]></category>

		<guid isPermaLink="false">http://richardbushnell.net/index.php/2008/01/28/aspnet-mvc-corollary-what-to-do/</guid>
		<description><![CDATA[Dude! I got quoted! And by none other than Rob Conery of SubSonic fame. It seems like my last post caused quite an unexpected stir. Thanks to both Rob and Scott for taking the time to answer me. I really appreciate it. A Word of Appreciation Let&#8217;s get something in perspective. Rob has actually produced [...]]]></description>
			<content:encoded><![CDATA[
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.richardbushnell.net%2F2008%2F01%2F28%2Faspnet-mvc-corollary-what-to-do%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="false" style="border:none; overflow:; width:450px; height:30px"></iframe>
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<br><p>Dude! I got <a href="http://blog.wekeroad.com/2008/01/25/ramble-aspnet-mvc-is-a-geek-chisel/" target="_blank">quoted</a>! And by none other than Rob Conery of SubSonic fame.</p>
<p>It seems like my <a href="http://richardbushnell.net/index.php/2008/01/25/does-the-aspnet-mvc-framework-frustrate-you/" target="_blank">last post</a> caused quite an unexpected stir. Thanks to both <a href="http://blog.wekeroad.com/2008/01/25/ramble-aspnet-mvc-is-a-geek-chisel/" target="_blank">Rob</a> and <a href="http://www.hanselman.com/blog/" target="_blank">Scott</a> for taking the time to answer me. I really appreciate it.<br />
<span id="more-43"></span></p>
<h2>A Word of Appreciation</h2>
<p>Let&#8217;s get something in perspective. Rob has actually <em>produced</em> something of immense value with SubSonic. I have just <em>complained </em>about it. Rob could very easily have just hammered me down, but he didn&#8217;t. Thanks, Rob.</p>
<p>Scott too.</p>
<p>In the <a href="http://www.hanselman.com/blog/HanselminutesPodcast98RaisingGeeksWithScottsDad.aspx" target="_blank">last episode of his most excellent podcast</a>, Scott said to his Dad that he likes to stir things up. &#8220;Presenting options&#8221; was the phrase I think he used. In that case, we are two peas in a pod. I <em>always</em> like to ask questions. If my question uncovers an unjustified assumption, things usually get better. If I&#8217;m wrong, then at least I come out knowing why I was wrong and understand the problem better.</p>
<p>While studying for my physics degree, I was asked to give feedback for a course on &#8220;Cosmic Dust&#8221;. I commented that it was just a completely pointless course. I mean, why waste 12 weeks of lectures studying the invisible dust floating around in space? Instead of numbing our brains with such useless information, we could have been learning something much more relevant. That particular comment, although made privately, really stirred up the lecturer. He got quite mad actually. He even wrote a long letter to the students with his  reasoning for why cosmic dust was so important. That itself was unprecedented. No lecturer had ever given us feedback to our feedback before.</p>
<p>Not much changed in the end, but at least I came out of it understanding more about what I&#8217;d been doing. Maybe that will happen with ASP.Net MVC.</p>
<p>So thanks to both of you for taking me seriously.</p>
<h2>How Dare They!</h2>
<p>Last month I watched a documentary about J.K. Rowling. It followed her as she completed and published the 7th and final Harry Potter book. It was the fasting selling book of all time. Truly amazing. But what amazed me most about the whole documentary was a comment made by two girls who had been queuing all night to get their copy of the book:</p>
<blockquote><p>&#8220;Finally! We&#8217;ve been waiting 10 years for this!&#8221;</p></blockquote>
<p>The remark was made with a tinge of disgust. It was as if the author had no right to take such a long time writing the book. How dare Mrs Rowling take so much time to finish her book while they had to suffer while sitting around waiting for it. How inconvenient for them! How inconsiderate of Mrs Rowling!</p>
<p>I thought, &#8220;if you wanted the book so much, why didn&#8217;t you write your own?&#8221;</p>
<p>In that spirit, I&#8217;m going to try to do something about the ASP.Net MVC thing myself. I don&#8217;t want to be that kind of person that complains but does nothing.</p>
<h2>Wait! There&#8217;s a baby in that bath-water!</h2>
<p>I read <a href="http://blog.wekeroad.com/2008/01/25/ramble-aspnet-mvc-is-a-geek-chisel/" target="_blank">Rob&#8217;s readers&#8217; comments</a>, and I think that it doesn&#8217;t require a full rewrite of ASP.Net to do what they want. In fact, I already wrote a bit of code, modeled loosely on <a href="http://www.djangoproject.com/documentation/templates/" target="_blank">Django templates</a>, which allows an ASP.Net developer to control the page output pretty much the same way as MVC promises to do. I&#8217;ll have to dig the code out of its hiding place, but then I plan to integrate it with a small Model-View-Presenter framework (a couple of generic base-classes for a Page and Presenter) which will enable a much better way for writing pages than the normal ASP.Net pages do. It also allows full testing of the controlling code.</p>
<p>And better yet, the MVP stuff is based on a refactored and simplified version of some Patterns and Practices code. (Yaaay, we can all be happy together!)</p>
<p>I&#8217;ve used this pattern, and each Presenter class is usually a few lines long. My ASP.Net page only contains presentation logic, i.e. stuff to render the page and retrieve input. I don&#8217;t need a controller nor a completely new framework to do it. In fact, a Controller class would be much worse, IMHO, because Controllers contain the code for more than one concern &#8211; a list page, an edit page, a delete page, etc. (I think that those things could be pragmatically abstracted and made easier anyhow, but that&#8217;s another story.) I personally prefer to keep my concerns separate.</p>
<p>And I&#8217;m not the only one who likes MVP. <a href="http://weblogs.asp.net/craigshoemaker/archive/2007/12/06/podcast-asp-net-mvc-and-the-future-of-model-view-presenter-interview-with-jeffery-palermo.aspx" target="_blank">Craig Shoemaker</a> does too.</p>
<p>So here&#8217;s my plan: I&#8217;ll try to publish some ideas and persuade you all to use them. Then I&#8217;ll get Microsoft to take Routes, Controllers, and whatever other goodies they&#8217;ve got in ASP.Net MVC, and put them in the next full-blown version of ASP.Net. Then everyone can use them and we can carry on with life as normal. I won&#8217;t have to use UrlRewriter to do my Routing any more and Microsoft can go back and finish off Workflow Foundation, ASP.Net Ajax, and Patterns and Practices.</p>
<p>Well, that&#8217;s the plan, anyway.</p>
<p>(I&#8217;ve just got to tidy up some of my code before I publish it. Give me a moment&#8230;)</p>

<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.richardbushnell.net%2F2008%2F01%2F28%2Faspnet-mvc-corollary-what-to-do%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="false" style="border:none; overflow:; width:450px; height:30px"></iframe>
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
]]></content:encoded>
			<wfw:commentRss>http://www.richardbushnell.net/2008/01/28/aspnet-mvc-corollary-what-to-do/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.Net Source Code Now Available</title>
		<link>http://www.richardbushnell.net/2008/01/17/net-source-code-now-available/</link>
		<comments>http://www.richardbushnell.net/2008/01/17/net-source-code-now-available/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 07:54:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[scott guthrie]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://richardbushnell.net/index.php/2008/01/17/net-source-code-now-available/</guid>
		<description><![CDATA[Scott Guthrie has just announced that the source code for the .Net framework has just been made available for reference use. It will be particularly useful to see how the controls in ASP.Net and Windows Forms have been done. Detailed instructions for how to set it up are here. One caveat: it&#8217;s not available for [...]]]></description>
			<content:encoded><![CDATA[
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.richardbushnell.net%2F2008%2F01%2F17%2Fnet-source-code-now-available%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="false" style="border:none; overflow:; width:450px; height:30px"></iframe>
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<br><p><a href="http://weblogs.asp.net/scottgu" target="_blank">Scott Guthrie</a> has just announced that the source code for the .Net framework has <a href="http://weblogs.asp.net/scottgu/archive/2008/01/16/net-framework-library-source-code-now-available.aspx" target="_blank">just been made available for reference use</a>.</p>
<p>It will be particularly useful to see how the controls in ASP.Net and Windows Forms have been done.</p>
<p>Detailed instructions for how to set it up are <a href="http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx" target="_blank">here</a>.</p>
<p>One caveat: it&#8217;s not available for the Express editions of Visual Studio. Shame! I was just starting to have some fun with them too.</p>

<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.richardbushnell.net%2F2008%2F01%2F17%2Fnet-source-code-now-available%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="false" style="border:none; overflow:; width:450px; height:30px"></iframe>
<!-- using Like-Button-Plugin-For-Wordpress [v4.2] | by http://www.gb-world.net -->
]]></content:encoded>
			<wfw:commentRss>http://www.richardbushnell.net/2008/01/17/net-source-code-now-available/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
