<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Lasse Eskildsen</title><link>http://weblogs.asp.net/lasse/default.aspx</link><description>Everyday life of a .NET developer</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/LasseEskildsen" /><feedburner:info uri="lasseeskildsen" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>Blog moved!</title><link>http://feedproxy.google.com/~r/LasseEskildsen/~3/tPJRINPHBHU/blog-moved.aspx</link><pubDate>Tue, 10 Nov 2009 20:19:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7250825</guid><dc:creator>lasseeskildsen</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/lasse/rsscomments.aspx?PostID=7250825</wfw:commentRss><comments>http://weblogs.asp.net/lasse/archive/2009/11/10/blog-moved.aspx#comments</comments><description>I have moved my blog to &lt;a href="http://blog.lasseeskildsen.net/"&gt;http://blog.lasseeskildsen.net/&lt;/a&gt; - stay tuned ;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7250825" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/LasseEskildsen/~4/tPJRINPHBHU" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/lasse/archive/tags/.NET/default.aspx">.NET</category><feedburner:origLink>http://weblogs.asp.net/lasse/archive/2009/11/10/blog-moved.aspx</feedburner:origLink></item><item><title>The asp.net &lt;deployment retail=”true” /&gt; attribute</title><link>http://feedproxy.google.com/~r/LasseEskildsen/~3/LJdQKPNDT-U/the-asp-net-lt-deployment-retail-true-gt-attribute.aspx</link><pubDate>Tue, 28 Apr 2009 20:39:20 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7064008</guid><dc:creator>lasseeskildsen</dc:creator><slash:comments>3</slash:comments><wfw:commentRss>http://weblogs.asp.net/lasse/rsscomments.aspx?PostID=7064008</wfw:commentRss><comments>http://weblogs.asp.net/lasse/archive/2009/04/28/the-asp-net-lt-deployment-retail-true-gt-attribute.aspx#comments</comments><description>&lt;p&gt;When deploying ASP.NET applications to a production environment, you will most likely want to set the compilation debug attribute in web.config to false, as having debug set to true has some downsides:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Compilation takes longer as batch optimizations are disabled &lt;/li&gt;    &lt;li&gt;Scripts and images from WebResources.axd will not be cached on the client &lt;/li&gt;    &lt;li&gt;Larger memory footprint &lt;/li&gt;    &lt;li&gt;Code will execute slower because of enabled debug paths &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;To force debug = false in all ASP.NET applications on the server, you can change the retail switch in machine.config:&lt;/p&gt;  &lt;p&gt;&amp;lt;configuration&amp;gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;system.web&amp;gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;deployment retail=&amp;quot;true&amp;quot;/&amp;gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/system.web&amp;gt; &lt;/p&gt;  &lt;p&gt;&amp;lt;/configuration&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This will also disable page output trace and force custom error pages.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7064008" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/LasseEskildsen/~4/LJdQKPNDT-U" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/lasse/archive/tags/Performance/default.aspx">Performance</category><category domain="http://weblogs.asp.net/lasse/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/lasse/archive/tags/ASP.NET/default.aspx">ASP.NET</category><feedburner:origLink>http://weblogs.asp.net/lasse/archive/2009/04/28/the-asp-net-lt-deployment-retail-true-gt-attribute.aspx</feedburner:origLink></item><item><title>TechEd 2008 Podcast</title><link>http://feedproxy.google.com/~r/LasseEskildsen/~3/pgSNLnqudgc/teched-2008-podcast.aspx</link><pubDate>Tue, 02 Dec 2008 21:18:07 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6763143</guid><dc:creator>lasseeskildsen</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/lasse/rsscomments.aspx?PostID=6763143</wfw:commentRss><comments>http://weblogs.asp.net/lasse/archive/2008/12/02/teched-2008-podcast.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/TechEd2008Podcast_1399B/teched_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="117" alt="teched" src="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/TechEd2008Podcast_1399B/teched_thumb.png" width="240" align="right" border="0" /&gt;&lt;/a&gt; Not too long ago I did a podcast with &lt;a href="http://www.publicvoid.dk"&gt;S&amp;#248;ren&lt;/a&gt; from Aarhus .NET Usergroup (&lt;a href="http://www.anug.dk"&gt;ANUG&lt;/a&gt;) about my trip to TechEd in Barcelona. It's in Danish, and you can find it right &lt;a href="http://www.anug.dk/post/2008/11/30/ANUGCast-10-TechEd-for-Developers-2008-med-Lasse-Eskildsen.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;In august I did another podcast with S&amp;#248;ren after my &lt;a href="http://www.subsonicproject.com"&gt;SubSonic&lt;/a&gt; presentation, and you can find that one right &lt;a href="http://www.anug.dk/post/2008/09/02/ANUGCasts-og-pilot.aspx"&gt;here&lt;/a&gt;, and the &lt;a href="http://www.anug.dk/post/2008/09/02/SubSonic-verdens-nemmeste-ORM-opsummering.aspx"&gt;code and slides is one the site too&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6763143" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/LasseEskildsen/~4/pgSNLnqudgc" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/lasse/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/lasse/archive/tags/TechEd/default.aspx">TechEd</category><feedburner:origLink>http://weblogs.asp.net/lasse/archive/2008/12/02/teched-2008-podcast.aspx</feedburner:origLink></item><item><title>Demystifying the Page_Load Method</title><link>http://feedproxy.google.com/~r/LasseEskildsen/~3/Y1X9FZ_zm0I/demystifying-the-page-load-method.aspx</link><pubDate>Thu, 20 Nov 2008 22:43:04 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6748860</guid><dc:creator>lasseeskildsen</dc:creator><slash:comments>5</slash:comments><wfw:commentRss>http://weblogs.asp.net/lasse/rsscomments.aspx?PostID=6748860</wfw:commentRss><comments>http://weblogs.asp.net/lasse/archive/2008/11/20/demystifying-the-page-load-method.aspx#comments</comments><description>&lt;p&gt;During a debugging session today &lt;a href="http://www.publicvoid.dk"&gt;S&amp;#248;ren&lt;/a&gt; and I got to talk about how the Page_Load method on a page is called.&lt;/p&gt;  &lt;p&gt;The method is called after the &lt;em&gt;Load&lt;/em&gt; event and is declared like this:&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; height: 80px; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Page_Load(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, EventArgs e)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Taking a look at the Page class in &lt;a href="http://www.red-gate.com/products/reflector/"&gt;Reflector&lt;/a&gt; shows the it inherits from the TemplateControl class. All the following code is extracted using Reflector.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/DemystifyingthePage_LoadMethod_14AA7/page_load1_1.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="182" alt="page_load1" src="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/DemystifyingthePage_LoadMethod_14AA7/page_load1_thumb_1.jpg" width="240" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;If we take a look at the TemplateControl class we can see that following constants are declared:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; _onTransactionAbortEventName = &lt;span style="color: #006080"&gt;&amp;quot;OnTransactionAbort&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; _onTransactionCommitEventName = &lt;span style="color: #006080"&gt;&amp;quot;OnTransactionCommit&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; _pageAbortTransactionEventName = &lt;span style="color: #006080"&gt;&amp;quot;Page_AbortTransaction&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; _pageCommitTransactionEventName = &lt;span style="color: #006080"&gt;&amp;quot;Page_CommitTransaction&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; _pageDataBindEventName = &lt;span style="color: #006080"&gt;&amp;quot;Page_DataBind&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; _pageErrorEventName = &lt;span style="color: #006080"&gt;&amp;quot;Page_Error&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; _pageInitCompleteEventName = &lt;span style="color: #006080"&gt;&amp;quot;Page_InitComplete&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; _pageInitEventName = &lt;span style="color: #006080"&gt;&amp;quot;Page_Init&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; _pageLoadCompleteEventName = &lt;span style="color: #006080"&gt;&amp;quot;Page_LoadComplete&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; _pageLoadEventName = &lt;span style="color: #006080"&gt;&amp;quot;Page_Load&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; _pagePreInitEventName = &lt;span style="color: #006080"&gt;&amp;quot;Page_PreInit&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; _pagePreLoadEventName = &lt;span style="color: #006080"&gt;&amp;quot;Page_PreLoad&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; _pagePreRenderCompleteEventName = &lt;span style="color: #006080"&gt;&amp;quot;Page_PreRenderComplete&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; _pagePreRenderEventName = &lt;span style="color: #006080"&gt;&amp;quot;Page_PreRender&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; _pageSaveStateCompleteEventName = &lt;span style="color: #006080"&gt;&amp;quot;Page_SaveStateComplete&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; _pageUnloadEventName = &lt;span style="color: #006080"&gt;&amp;quot;Page_Unload&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Right there on line 10 you can the name of the Page_Load method declared. If you declare a method with the same signature as the default generated Page_Load method, but name them after the constants declared above they will automatically get called appropriately.&lt;/p&gt;

&lt;p&gt;The reason why, is found in the HookUpAutomaticHandlers() method on the TemplateControl class which eventually calls the GetDelegateInformationFromMethod(string, IDictionary) method. The source looks something like this (please excuse the variable naming). Methods are listed in the order which they are called:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;internal&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; HookUpAutomaticHandlers()&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.SupportAutoEvents)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; obj2 = _eventListCache[&lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.GetType()];&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;         IDictionary dictionary = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (obj2 == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;lock&lt;/span&gt; (_lockObject)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;             {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;                 obj2 = _eventListCache[&lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.GetType()];&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (obj2 == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;                 {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;                     dictionary = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ListDictionary();&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;                     &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetDelegateInformation(dictionary);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;                     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (dictionary.Count == 0)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;                     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;                         obj2 = _emptyEventSingleton;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;                     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;                     &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt;                     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  22:&lt;/span&gt;                         obj2 = dictionary;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  23:&lt;/span&gt;                     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  24:&lt;/span&gt;                     _eventListCache[&lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.GetType()] = obj2;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  25:&lt;/span&gt;                 }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  26:&lt;/span&gt;             }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  27:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  28:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (obj2 != _emptyEventSingleton)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  29:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  30:&lt;/span&gt;             dictionary = (IDictionary) obj2;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  31:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; str &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; dictionary.Keys)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  32:&lt;/span&gt;             {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  33:&lt;/span&gt;                 EventMethodInfo info = (EventMethodInfo) dictionary[str];&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  34:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; flag = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  35:&lt;/span&gt;                 MethodInfo methodInfo = info.MethodInfo;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  36:&lt;/span&gt;                 Delegate delegate2 = &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.Events[_eventObjects[str]];&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  37:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (delegate2 != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  38:&lt;/span&gt;                 {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  39:&lt;/span&gt;                     &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (Delegate delegate3 &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; delegate2.GetInvocationList())&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  40:&lt;/span&gt;                     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  41:&lt;/span&gt;                         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (delegate3.Method.Equals(methodInfo))&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  42:&lt;/span&gt;                         {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  43:&lt;/span&gt;                             flag = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  44:&lt;/span&gt;                             &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  45:&lt;/span&gt;                         }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  46:&lt;/span&gt;                     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  47:&lt;/span&gt;                 }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  48:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!flag)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  49:&lt;/span&gt;                 {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  50:&lt;/span&gt;                     IntPtr functionPointer = methodInfo.MethodHandle.GetFunctionPointer();&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  51:&lt;/span&gt;                     EventHandler handler = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; CalliEventHandlerDelegateProxy(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;, functionPointer, info.IsArgless).Handler;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  52:&lt;/span&gt;                     &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.Events.AddHandler(_eventObjects[str], handler);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  53:&lt;/span&gt;                 }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  54:&lt;/span&gt;             }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  55:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  56:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  57:&lt;/span&gt; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  58:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  59:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; GetDelegateInformation(IDictionary dictionary)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  60:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  61:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (HttpRuntime.IsFullTrust)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  62:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  63:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetDelegateInformationWithNoAssert(dictionary);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  64:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  65:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  66:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  67:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetDelegateInformationWithAssert(dictionary);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  68:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  69:&lt;/span&gt; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  70:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  71:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; GetDelegateInformationWithNoAssert(IDictionary dictionary)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  72:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  73:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; &lt;span style="color: #0000ff"&gt;is&lt;/span&gt; Page)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  74:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  75:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetDelegateInformationFromMethod(&lt;span style="color: #006080"&gt;&amp;quot;Page_PreInit&amp;quot;&lt;/span&gt;, dictionary);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  76:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetDelegateInformationFromMethod(&lt;span style="color: #006080"&gt;&amp;quot;Page_PreLoad&amp;quot;&lt;/span&gt;, dictionary);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  77:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetDelegateInformationFromMethod(&lt;span style="color: #006080"&gt;&amp;quot;Page_LoadComplete&amp;quot;&lt;/span&gt;, dictionary);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  78:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetDelegateInformationFromMethod(&lt;span style="color: #006080"&gt;&amp;quot;Page_PreRenderComplete&amp;quot;&lt;/span&gt;, dictionary);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  79:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetDelegateInformationFromMethod(&lt;span style="color: #006080"&gt;&amp;quot;Page_InitComplete&amp;quot;&lt;/span&gt;, dictionary);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  80:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetDelegateInformationFromMethod(&lt;span style="color: #006080"&gt;&amp;quot;Page_SaveStateComplete&amp;quot;&lt;/span&gt;, dictionary);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  81:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  82:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetDelegateInformationFromMethod(&lt;span style="color: #006080"&gt;&amp;quot;Page_Init&amp;quot;&lt;/span&gt;, dictionary);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  83:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetDelegateInformationFromMethod(&lt;span style="color: #006080"&gt;&amp;quot;Page_Load&amp;quot;&lt;/span&gt;, dictionary);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  84:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetDelegateInformationFromMethod(&lt;span style="color: #006080"&gt;&amp;quot;Page_DataBind&amp;quot;&lt;/span&gt;, dictionary);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  85:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetDelegateInformationFromMethod(&lt;span style="color: #006080"&gt;&amp;quot;Page_PreRender&amp;quot;&lt;/span&gt;, dictionary);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  86:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetDelegateInformationFromMethod(&lt;span style="color: #006080"&gt;&amp;quot;Page_Unload&amp;quot;&lt;/span&gt;, dictionary);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  87:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetDelegateInformationFromMethod(&lt;span style="color: #006080"&gt;&amp;quot;Page_Error&amp;quot;&lt;/span&gt;, dictionary);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  88:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetDelegateInformationFromMethod(&lt;span style="color: #006080"&gt;&amp;quot;Page_AbortTransaction&amp;quot;&lt;/span&gt;, dictionary))&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  89:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  90:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetDelegateInformationFromMethod(&lt;span style="color: #006080"&gt;&amp;quot;OnTransactionAbort&amp;quot;&lt;/span&gt;, dictionary);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  91:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  92:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetDelegateInformationFromMethod(&lt;span style="color: #006080"&gt;&amp;quot;Page_CommitTransaction&amp;quot;&lt;/span&gt;, dictionary))&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  93:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  94:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetDelegateInformationFromMethod(&lt;span style="color: #006080"&gt;&amp;quot;OnTransactionCommit&amp;quot;&lt;/span&gt;, dictionary);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  95:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  96:&lt;/span&gt; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  97:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  98:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; GetDelegateInformationFromMethod(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; methodName, IDictionary dictionary)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  99:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 100:&lt;/span&gt;     EventHandler handler = (EventHandler) Delegate.CreateDelegate(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(EventHandler), &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;, methodName, &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 101:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (handler != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 102:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 103:&lt;/span&gt;         dictionary[methodName] = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; EventMethodInfo(handler.Method, &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 104:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 105:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 106:&lt;/span&gt;     VoidMethod method = (VoidMethod) Delegate.CreateDelegate(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(VoidMethod), &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;, methodName, &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 107:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (method != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 108:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 109:&lt;/span&gt;         dictionary[methodName] = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; EventMethodInfo(method.Method, &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 110:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 111:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 112:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt; 113:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;On line 15 the delegates are all collected into a dictionary using the GetDelegateInformationFromMethod method. On lines 31 to 53 the MethodInfos are collected, and handlers is added to the events collection. When raising the associated events (e.g. &lt;em&gt;Load &lt;/em&gt;for the Page_Load method), the MethodInfo is invoked from the Events-collection.&lt;/p&gt;

&lt;p&gt;The HookUpAutomaticHandlers method is called from the SetIntrinsics method on the Page class.&lt;/p&gt;

&lt;h1&gt;Summary&lt;/h1&gt;

&lt;p&gt;So to sum up, the Page_Load method and all it's colleagues (Page_Init, Page_DataBind etc.) are not invoked using slow reflection, but is simply grabbed as a named delegate. I'm not used to use these delegates, but from now on I don't see any reason why not to use them, instead of overriding the OnInit, OnPreRender etc. methods.&lt;/p&gt;

&lt;p&gt;Well, nothing new in this one, just stuff thats makes me wonder :o)&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6748860" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/LasseEskildsen/~4/Y1X9FZ_zm0I" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/lasse/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/lasse/archive/tags/ASP.NET/default.aspx">ASP.NET</category><feedburner:origLink>http://weblogs.asp.net/lasse/archive/2008/11/20/demystifying-the-page-load-method.aspx</feedburner:origLink></item><item><title>Spec# To Be Replaced By Code Contracts?</title><link>http://feedproxy.google.com/~r/LasseEskildsen/~3/sBGtpIgyVk8/spec-to-be-replaced-by-code-contracts.aspx</link><pubDate>Sun, 16 Nov 2008 23:19:01 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6742134</guid><dc:creator>lasseeskildsen</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/lasse/rsscomments.aspx?PostID=6742134</wfw:commentRss><comments>http://weblogs.asp.net/lasse/archive/2008/11/17/spec-to-be-replaced-by-code-contracts.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/SpecToBeReplacedByCodeContracts_473/ms_masthead_ltr_2.gif"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="42" alt="ms_masthead_ltr" src="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/SpecToBeReplacedByCodeContracts_473/ms_masthead_ltr_thumb.gif" width="136" align="right" border="0" /&gt;&lt;/a&gt;As you might have seen from a &lt;a href="http://weblogs.asp.net/lasse/archive/2008/10/30/enforcing-your-domain-model-with-spec-part-1-introduction-and-the-non-null-operator.aspx"&gt;previous post&lt;/a&gt; I'm pretty excided on Spec# from Microsoft Research, so when my collegue &lt;a href="http://www.publicvoid.dk"&gt;S&amp;#248;ren&lt;/a&gt; returned from&amp;#160; PDC and he told me that Spec# would replaced by &lt;a href="http://research.microsoft.com/contracts/"&gt;Code Contracts&lt;/a&gt; I felt kind of disappointed. However, having looked briefly at Code Contracts I must admit that it looks pretty cool. It is especially worth noticing that Code Contract seems to be working well with &lt;a href="http://research.microsoft.com/pex/"&gt;Pex&lt;/a&gt;. How cool would it be to be able to test your domain model with Pex! Because of this, the next articles on Spec# is put on hold, but will eventually continue as either Code Contracts or Spec# posts (actually hoping it's going to be Code Contracts).&lt;/p&gt;  &lt;p&gt;I haven't been able to find more on this anywhere, so please do not just take my word for it. However, a couple of team members are both on the Spec# and the Code Contracts team. Feel free to drop a comment if you have more info on this!&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6742134" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/LasseEskildsen/~4/sBGtpIgyVk8" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/lasse/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/lasse/archive/tags/Spec_2300_/default.aspx">Spec#</category><category domain="http://weblogs.asp.net/lasse/archive/tags/Domain+Driven+Design/default.aspx">Domain Driven Design</category><feedburner:origLink>http://weblogs.asp.net/lasse/archive/2008/11/17/spec-to-be-replaced-by-code-contracts.aspx</feedburner:origLink></item><item><title>TechEd 2008: Day 4 and 5</title><link>http://feedproxy.google.com/~r/LasseEskildsen/~3/OcdCbtdaU8Q/teched-2008-day-4-and-5.aspx</link><pubDate>Sun, 16 Nov 2008 22:40:36 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6742039</guid><dc:creator>lasseeskildsen</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://weblogs.asp.net/lasse/rsscomments.aspx?PostID=6742039</wfw:commentRss><comments>http://weblogs.asp.net/lasse/archive/2008/11/16/teched-2008-day-4-and-5.aspx#comments</comments><description>&lt;p&gt;This post has been a couple of days on it's way. The reason for not posting it after each day is that there was not much new that you could not already find on almost every .net blog out there. &lt;/p&gt;  &lt;p&gt;Thursday I attended a session on &lt;a href="http://msdn.microsoft.com/en-us/data/cc655792.aspx"&gt;&amp;quot;Velocity&amp;quot;&lt;/a&gt;, Microsoft's upcoming solution to distributed in-memory cache. This is pretty cool and straight forward (at least for the basic stuff). To demonstrate this, a member of the audience set up Velocity on two servers in a few minutes. This reminded me of the importance of the abstractions we normally use on various features. With a simple abstraction for caching, I really believe you could make the switch to Velocity in a day. &lt;/p&gt;  &lt;p&gt;I also attended an XNA session. Before leaving home, I actually decided not to go to that kind of sessions, but as you might have guessed, I changed my mind. Game development is a really hardcore object oriented discipline, and my idea is that a good game developer makes a hardcore application developer, and the session gave a good idea on a completly different way of using objects, methods, loops and more. Pretty cool, if I ever get the time (I doubt it) I'll put my old XBOX 360 to good use with XNA :o)&lt;/p&gt;  &lt;p&gt;Friday I attended a very cool session with &lt;a href="http://www.udidahan.com/"&gt;Udi Dahan&lt;/a&gt; on architecture, how to make interfaces concrete, and how he and his team resolved some of their (architectural) issues. Pretty cool guy, and a very inspirering session. I really like the following slide. It's on why to make roles explicit using interfaces.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/TechEd2008Day4and5_14CF0/IMAGE_095_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="318" alt="IMAGE_095" src="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/TechEd2008Day4and5_14CF0/IMAGE_095_thumb.jpg" width="240" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h1&gt;Final Impressions&lt;/h1&gt;  &lt;p&gt;It has definitely been a unique experience to participate in the conference, I cannot help but to feel kind of privileged to be &lt;a href="http://www.vertica.dk"&gt;working in a company&lt;/a&gt; that realises this! I have agreed to participate in a podcast by &lt;a href="http://www.publicvoid.dk/"&gt;S&amp;#248;ren&lt;/a&gt; about the general TechEd experience, so stay tuned.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6742039" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/LasseEskildsen/~4/OcdCbtdaU8Q" height="1" width="1"/&gt;</description><feedburner:origLink>http://weblogs.asp.net/lasse/archive/2008/11/16/teched-2008-day-4-and-5.aspx</feedburner:origLink></item><item><title>TechEd 2008: Day 3</title><link>http://feedproxy.google.com/~r/LasseEskildsen/~3/l_CxPvZFGAA/teched-2008-day-3.aspx</link><pubDate>Wed, 12 Nov 2008 21:43:28 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6731629</guid><dc:creator>lasseeskildsen</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/lasse/rsscomments.aspx?PostID=6731629</wfw:commentRss><comments>http://weblogs.asp.net/lasse/archive/2008/11/12/teched-2008-day-3.aspx#comments</comments><description>&lt;p&gt;Wow, a lot of cool stuff today!&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Building custom Linq providers with &lt;a href="http://community.bartdesmet.net/blogs/bart/Default.aspx"&gt;Bart de Smet (B#)&lt;/a&gt; - cool!&lt;/li&gt;    &lt;li&gt;&amp;quot;Web Scalability and Asynchronous Systems Architecture&amp;quot;&lt;/li&gt;    &lt;li&gt;Deep reflection with &lt;a href="http://weblogs.asp.net/ROsherove/"&gt;Roy Osherove&lt;/a&gt; (from TypeMock), cool guy and a very cool session! Learned a lot about DynamicMethod, Reflection.Emit and IL!&lt;/li&gt;    &lt;li&gt;Hardcore ASP.NET performance and memory debugging with &lt;a href="http://blogs.msdn.com/tess/"&gt;Tess Ferrandez&lt;/a&gt;. This was really cool, something I definitely will be using, so expect some blogposts on this. Until then, take a look at Tess' blog and her BuggyBits lab.&lt;/li&gt;    &lt;li&gt;Country drinks... 'Nuff said... &lt;/li&gt; &lt;/ul&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6731629" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/LasseEskildsen/~4/l_CxPvZFGAA" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/lasse/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/lasse/archive/tags/TechEd/default.aspx">TechEd</category><feedburner:origLink>http://weblogs.asp.net/lasse/archive/2008/11/12/teched-2008-day-3.aspx</feedburner:origLink></item><item><title>TechEd 2008: Day 2</title><link>http://feedproxy.google.com/~r/LasseEskildsen/~3/hdgzSBdElKE/teched-2008-day-2.aspx</link><pubDate>Tue, 11 Nov 2008 19:41:24 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6729591</guid><dc:creator>lasseeskildsen</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://weblogs.asp.net/lasse/rsscomments.aspx?PostID=6729591</wfw:commentRss><comments>http://weblogs.asp.net/lasse/archive/2008/11/11/teched-2008-day-2.aspx#comments</comments><description>&lt;p&gt;Today I attended an introduction to &amp;quot;Oslo&amp;quot;, &amp;quot;Dublin&amp;quot; and WF 4.0, Commerce Server &amp;quot;Mojave&amp;quot;, ASP.NET MVC basics, ASP.NET MVC tech deep dive, data centric web applications and a very abstract architectural session.&lt;/p&gt;  &lt;p&gt;There's really not much to blog about as the web is already full of MVC stuff, which were the most exciting part of the day. Until today I have been somewhat sceptic of ASP.NET MVC as it left me with the same feeling as when I did ASP Classic some years ago. &lt;/p&gt;  &lt;p&gt;Today that changed! &lt;a href="http://www.lostintangent.com/"&gt;Jonathan Carter&lt;/a&gt; and &lt;a href="http://hadihariri.com/blogengine/"&gt;Hadi Hariri&lt;/a&gt; gave some cool presentations showing a lot of nice features. In the last session, Hadi talked about how to customize the various parts of ASP.NET MVC, from controller factories using IoC to implementing custom filters (and a lot more!).&lt;/p&gt;  &lt;p&gt;Well, not much to blog about, this post is most to let my colleagues know I'm still alive :-) &lt;/p&gt;  &lt;p&gt;Tomorrow is about some more advanced ASP.NET stuff, debugging and performance profiling, and last but definitely not least: Country drinks :-)&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6729591" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/LasseEskildsen/~4/hdgzSBdElKE" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/lasse/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/lasse/archive/tags/TechEd/default.aspx">TechEd</category><feedburner:origLink>http://weblogs.asp.net/lasse/archive/2008/11/11/teched-2008-day-2.aspx</feedburner:origLink></item><item><title>TechEd 2008: Day 1</title><link>http://feedproxy.google.com/~r/LasseEskildsen/~3/3YSQXWlCCio/teched-2008-day-1.aspx</link><pubDate>Mon, 10 Nov 2008 20:47:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6728749</guid><dc:creator>lasseeskildsen</dc:creator><slash:comments>10</slash:comments><wfw:commentRss>http://weblogs.asp.net/lasse/rsscomments.aspx?PostID=6728749</wfw:commentRss><comments>http://weblogs.asp.net/lasse/archive/2008/11/10/teched-2008-day-1.aspx#comments</comments><description>&lt;p&gt;So the first "real" day of TechEd is over, and here's some of the things that really impressed me today.&lt;/p&gt;  &lt;h1&gt;The keynote and "Camano"&lt;/h1&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/jasonz/" title="Jason Zander" mce_href="http://blogs.msdn.com/jasonz/"&gt;Jason Zander&lt;/a&gt; gave the keynote, where he showed a lot of the new features of Visual Studio 2010. One thing that was really cool was the "Camano" project. Camano is "just" an application which you connect to your team project in TFS. Testers can then use the software to go through test cases and approve or disapprove a test case. If a test case is disapproved, the tester can submit it as a bug to TFS. This is really cool, because Camano includes screen capture, so the steps to reproduce is recorded as a video in .wmv format. Furthermore, the application's state is captured too, so you can actually debug the application in Visual Studio using the exact state as when the bug occured! In addition, if virtual machines are used for testing, it can recreate the entire state of multiple machines as when the bug appeared. Now we devs have to come up with something else than "it works on my computer" :-)&lt;/p&gt;  &lt;p&gt;This is just one feature of Camona, it includes a lot more nice features - can't wait to get my hands on it!&lt;/p&gt;  &lt;h1&gt;Commerce Server "Mojave"&lt;/h1&gt;  &lt;p&gt;At the welcome reception after today's sessions, I ran in the Ryan Donovan and Scott Cairney. They gave a live demonstration of the upcomming Commerce Server release, code named "Mojave". Long story short, the next release contains a brand new sleek API, a pure non-COM .NET alternative to pipelines and comes with a very nice SharePoint integration. Furthermore, they demoed the new Silverlight based web tools where they showed live editing of products and variants using the Silverlight based tools - can't wait to try it out! The screenshot below (well, not so much screenshot as "shot-of-a-screen-taken-with-my-mobile") shows the new Starter Site running in SharePoint edit mode. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/TechEd2008Day1_1325B/IMAGE_060_2.jpg" mce_href="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/TechEd2008Day1_1325B/IMAGE_060_2.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/TechEd2008Day1_1325B/IMAGE_060_thumb.jpg" style="border: 0px none ;" alt="IMAGE_060" mce_src="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/TechEd2008Day1_1325B/IMAGE_060_thumb.jpg" border="0" height="377" width="285"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The first CTP is &lt;a href="http://blogs.msdn.com/commerce/archive/2008/10/20/commerce-server-2007-code-name-mojave-october-2008-community-technology-preview-ctp-is-available-for-download-from-the-microsoft-connect-site.aspx" mce_href="http://blogs.msdn.com/commerce/archive/2008/10/20/commerce-server-2007-code-name-mojave-october-2008-community-technology-preview-ctp-is-available-for-download-from-the-microsoft-connect-site.aspx"&gt;available for download&lt;/a&gt;, the next CTP is released in a few weeks, and the final release is scheduled for Q1 2009. Looking forward to it!&lt;/p&gt;  &lt;p&gt;Apart from the keynote and the reception I attended an architecture session, as well as a IronPython and IronRuby session - nice stuff too!&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6728749" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/LasseEskildsen/~4/3YSQXWlCCio" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/lasse/archive/tags/Commerce+Server/default.aspx">Commerce Server</category><category domain="http://weblogs.asp.net/lasse/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/lasse/archive/tags/TechEd/default.aspx">TechEd</category><feedburner:origLink>http://weblogs.asp.net/lasse/archive/2008/11/10/teched-2008-day-1.aspx</feedburner:origLink></item><item><title>TechEd 2008: Day 0</title><link>http://feedproxy.google.com/~r/LasseEskildsen/~3/v5IHJVw0EWQ/teched-2008-day-0.aspx</link><pubDate>Sun, 09 Nov 2008 20:44:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6727840</guid><dc:creator>lasseeskildsen</dc:creator><slash:comments>3</slash:comments><wfw:commentRss>http://weblogs.asp.net/lasse/rsscomments.aspx?PostID=6727840</wfw:commentRss><comments>http://weblogs.asp.net/lasse/archive/2008/11/09/teched-2008-day-0.aspx#comments</comments><description>&lt;p&gt;Today I arrived at Barcelona to attend TechEd for developers next week. After some waiting, some flight, a little more waiting, a little more flight, and an overly excited Spanish taxi driver I arrived at the hotel, which turned out to be pretty nice! &lt;/p&gt;  &lt;p&gt;Upon the registration at the conference center, I got my TechEd swag bag, and here's what it contains:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/TechEd2008Day0_13195/IMAGE_028_2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="365" alt="IMAGE_028" src="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/TechEd2008Day0_13195/IMAGE_028_thumb.jpg" width="485" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Take a look at the close up of the geeky t-shirt:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/TechEd2008Day0_13195/IMAGE_029_4.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="366" alt="IMAGE_029" src="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/TechEd2008Day0_13195/IMAGE_029_thumb_1.jpg" width="487" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Thank you Microsoft :-)&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6727840" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/LasseEskildsen/~4/v5IHJVw0EWQ" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/lasse/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/lasse/archive/tags/TechEd/default.aspx">TechEd</category><feedburner:origLink>http://weblogs.asp.net/lasse/archive/2008/11/09/teched-2008-day-0.aspx</feedburner:origLink></item><item><title>Enforcing Your Domain Model With Spec#: Part 1: Introduction And The Non-Null Operator</title><link>http://feedproxy.google.com/~r/LasseEskildsen/~3/UuoO-iC3Coc/enforcing-your-domain-model-with-spec-part-1-introduction-and-the-non-null-operator.aspx</link><pubDate>Thu, 30 Oct 2008 21:35:09 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6712924</guid><dc:creator>lasseeskildsen</dc:creator><slash:comments>3</slash:comments><wfw:commentRss>http://weblogs.asp.net/lasse/rsscomments.aspx?PostID=6712924</wfw:commentRss><comments>http://weblogs.asp.net/lasse/archive/2008/10/30/enforcing-your-domain-model-with-spec-part-1-introduction-and-the-non-null-operator.aspx#comments</comments><description>&lt;p&gt;I'm a huge fan of Domain Driven Design (DDD) (links &lt;a href="http://domaindrivendesign.org/"&gt;here&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Domain-driven_design"&gt;here&lt;/a&gt; and &lt;a href="http://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215"&gt;here&lt;/a&gt;) and this post is the first in many, all about enforcing your domain model using &lt;a href="http://research.microsoft.com/SpecSharp/"&gt;Spec#&lt;/a&gt;.&lt;/p&gt;  &lt;h1&gt;So What Is Spec#?&lt;/h1&gt;  &lt;p&gt;Spec# is a super set of C# 2.0 (no, unfortunately not 3.0 yet). This means that Spec# has all the features as C#, and all the Spec# stuff on top of that. &lt;/p&gt;  &lt;p&gt;Spec# is about &lt;em&gt;specifying, &lt;/em&gt;and because the guys at Microsoft probably explains it better than I do, I have &lt;strike&gt;stolen&lt;/strike&gt; copied this from the Spec# web site:&lt;/p&gt;  &lt;blockquote&gt;   &lt;ul&gt;     &lt;li&gt;The Spec# programming language.&amp;#160; Spec# is an extension of the object-oriented language C#.&amp;#160; It extends the type system to include non-null types and checked exceptions.&amp;#160; It provides method contracts in the form of pre- and postconditions as well as object invariants. &lt;/li&gt;      &lt;li&gt;The Spec# compiler.&amp;#160; Integrated into the Microsoft Visual Studio development environment for the .NET platform, the compiler statically enforces non-null types, emits run-time checks for method contracts and invariants, and records the contracts as metadata for consumption by downstream tools. &lt;/li&gt;      &lt;li&gt;The Spec# static program verifier.&amp;#160; This component (codenamed Boogie) generates logical verification conditions from a Spec# program.&amp;#160; Internally, it uses an automatic theorem prover that analyzes the verification conditions to prove the correctness of the program or find errors in it. &lt;/li&gt;   &lt;/ul&gt; &lt;/blockquote&gt;  &lt;p&gt;This first post explains the &lt;em&gt;non-null operator&lt;/em&gt;, so let's get to it.&lt;/p&gt;  &lt;h1&gt;The Non-Null Operator&lt;/h1&gt;  &lt;p&gt;The non-null operator is probably the most simple operator in Spec#, yet I find it very effecient to express e.g. value objects or aggregates in the domain.&lt;/p&gt;  &lt;p&gt;The non-null operator is in a way the opposite as the nullable operator in C#, which allows value types to be nullable. The non-null operator allows you to specify reference types as being non-nullable by using an exclamation mark (!).&lt;/p&gt;  &lt;p&gt;The C# way:&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Foo(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; o)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; o.ToString(); &lt;span style="color: #008000"&gt;// NullReferenceException&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Bar()&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; o = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; str = Foo(o);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;The Spec# way:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Foo(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt;! o)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; o.ToString();&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; BadBar()&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; o = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; str = Foo(o); &lt;span style="color: #008000"&gt;// Spec# warning&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; GoodBar()&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; o = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (o != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) &lt;span style="color: #008000"&gt;// We're ok&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;         Foo(o); &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;If o was initialized to something else than null in GoodBar() the Spec# compiler would be happy too. &lt;/p&gt;

&lt;p&gt;In a domain example an implementation could be something like this:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; height: 268px; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; OrderLineItem&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     ...&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// We're making the product property non-nullable as an order line item without a product&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// does not make much sense, it would just be a quantity of nothing.&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; IProduct! Product&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;         get; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; set; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Quantity&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;         get; set;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;     ...&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; PurchaseOrder&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  22:&lt;/span&gt;     ...&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  23:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  24:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; OrderLineItem AddProduct(IProduct! product, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; quantity)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  25:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  26:&lt;/span&gt;         &lt;span style="color: #008000"&gt;// Add product - no need to check for null&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  27:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  28:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  29:&lt;/span&gt;     ...&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  30:&lt;/span&gt; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  31:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  32:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Cart&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  33:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  34:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Add(IProduct product)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  35:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  36:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (product != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  37:&lt;/span&gt;             PurchaseOrder.AddProduct(product, 1);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  38:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  39:&lt;/span&gt;             &lt;span style="color: #008000"&gt;// Handle null product        &lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  40:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  41:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;In the example above, the caller of PurchaseOrder.AddProduct is forced to check for null before calling the method. This really encapsulates clean business logic in the PurchaseOrder and OrderLineItem classes. In C# you would create a guard clause at the top of the AddProduct method, but in order for a developer to know about this, he has to read the implementation of the method. By using Spec# the developer is made aware of this when calling the method.&lt;/p&gt;

&lt;p&gt;Please feel free the leave a comment or &lt;a href="http://weblogs.asp.net/lasse/contact.aspx"&gt;contact&lt;/a&gt; me of you have any questions or comments!&lt;/p&gt;

&lt;p&gt;Part 2 is all about preconditions... Coming up!&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6712924" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/LasseEskildsen/~4/UuoO-iC3Coc" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/lasse/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/lasse/archive/tags/Spec_2300_/default.aspx">Spec#</category><category domain="http://weblogs.asp.net/lasse/archive/tags/Domain+Driven+Design/default.aspx">Domain Driven Design</category><feedburner:origLink>http://weblogs.asp.net/lasse/archive/2008/10/30/enforcing-your-domain-model-with-spec-part-1-introduction-and-the-non-null-operator.aspx</feedburner:origLink></item><item><title>Got Source Control?</title><link>http://feedproxy.google.com/~r/LasseEskildsen/~3/75jZtTjQe8w/got-source-control.aspx</link><pubDate>Sun, 19 Oct 2008 17:59:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6690516</guid><dc:creator>lasseeskildsen</dc:creator><slash:comments>4</slash:comments><wfw:commentRss>http://weblogs.asp.net/lasse/rsscomments.aspx?PostID=6690516</wfw:commentRss><comments>http://weblogs.asp.net/lasse/archive/2008/10/19/got-source-control.aspx#comments</comments><description>&lt;p&gt;If you're a small team or a single person and find the need for some source control and backup, I can highly recommend &lt;a href="http://www.projectlocker.com" mce_href="http://www.projectlocker.com"&gt;ProjectLocker&lt;/a&gt;. It includes Trac for management, and BuildLocker can be added for CI. The uptime is amazing too! I use the &lt;a href="http://www.visualsvn.com/" mce_href="http://www.visualsvn.com/"&gt;VisualSVN client&lt;/a&gt; for Visual Studio along with &lt;a href="http://tortoisesvn.net/" mce_href="http://tortoisesvn.net/"&gt;TortoiseSVN&lt;/a&gt;, but it supports most tools.&lt;/p&gt;  &lt;p&gt;I use the lowest service level which includes unlimited repositories, 1 GB space and 2 users - the price is $2.50 pr month.&lt;/p&gt;  &lt;p&gt;And no, I don't get any royalties :)&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6690516" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/LasseEskildsen/~4/75jZtTjQe8w" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/lasse/archive/tags/.NET/default.aspx">.NET</category><feedburner:origLink>http://weblogs.asp.net/lasse/archive/2008/10/19/got-source-control.aspx</feedburner:origLink></item><item><title>Performance Profiling And Commerce Server 2007</title><link>http://feedproxy.google.com/~r/LasseEskildsen/~3/vMySEqd-2kU/performance-profiling-and-commerce-server-2007.aspx</link><pubDate>Thu, 16 Oct 2008 21:43:21 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6683332</guid><dc:creator>lasseeskildsen</dc:creator><slash:comments>4</slash:comments><wfw:commentRss>http://weblogs.asp.net/lasse/rsscomments.aspx?PostID=6683332</wfw:commentRss><comments>http://weblogs.asp.net/lasse/archive/2008/10/16/performance-profiling-and-commerce-server-2007.aspx#comments</comments><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;Not too long ago we had to do some performance profiling for a Commerce Server site that went into production a couple of months before. We knew we had some performance issues, but because of some inventory issues at the client, we had to rush the site into production.&lt;/p&gt;  &lt;p&gt;The first couple of days the performance was acceptable, but as more and more customers started hitting the site, some of the nasty issues we addressed started showing up. The site was stable though, just not the fastest one out there.&lt;/p&gt;  &lt;p&gt;The site is a pretty standard e-commerce site, not much fancy stuff on this one. The only exception is some very large categories rendering 500+ products on a single page.&lt;/p&gt;  &lt;h1&gt;First Things First: HTML Ad Libitum&lt;/h1&gt;  &lt;p&gt;Generating HTML for a category containing 500+ can be pretty tough on both the server and the client side. On the server side, the basic category layout was built using a couple of ASP.NET user controls and each product view consisted of a couple of user controls too. This provided a very flexible and configurable layout, but the performance for generating all those server controls and related markup was pretty tough for the server. The HTML output (without images) was about ~1.6 MB, which the browser wasn't too happy about either.&lt;/p&gt;  &lt;p&gt;So removing a lot of user controls and only one user control per product resulted in an HTML output around ~400 kb tops. No need to say that this had a major impact on performance. &lt;/p&gt;  &lt;p&gt;With the HTML all nice and cleaned up, we can start digging in to the inner workings of the site.&lt;/p&gt;  &lt;h1&gt;Next up: Tracing For Bottlenecks&lt;/h1&gt;  &lt;p&gt;To get a basic idea of where bottlenecks could be found, we turned to the ASP.NET Output Trace. It's pretty simple stuff, and I wrote some stuff the trace we I knew we had some issues. When displaying categories we had to do a lot of heavy filtering on product variants. Each product having about 10+ variants, a product list with 500 products would generate ~5.000 products to filter! &lt;/p&gt;  &lt;p&gt;However, the trace showed that this wasn't nearly as time consuming as I had imagined. A bigger problem was in a user controlle called CatalogTopMenu.ascx.&lt;/p&gt;  &lt;p&gt;At the top of the site the user can navigate through the catalogs available in the catalog set, implemented in CatalogTopMenu.ascx.&lt;/p&gt;  &lt;h1&gt;Bring In The Profiler&lt;/h1&gt;  &lt;p&gt;Of course, you could add stuff to the trace, compile, deploy, test, check trace, write down result, remove trace code, add more trace code, compile, deploy and so on. Instead we used &lt;a href="http://www.red-gate.com/Products/ants_profiler/index.htm"&gt;ANTS Profiler&lt;/a&gt; from &lt;a href="http://www.red-gate.com"&gt;Red Gate&lt;/a&gt;. I really love this tool, it fairly easy to use, but it provides some real useful result. If you find yourself in need of a performance profiler I can highly recommend trying this one - there's a 14-day free trial available on their web site.&lt;/p&gt;  &lt;h2&gt;Setting Up ANTS Profiler For Commerce Server&lt;/h2&gt;  &lt;p&gt;When profiling an ASP.NET site, ANTS Profiler starts a new instance of the worker process (w3wp.exe), which runs the site you're profiling. Because Commerce Server requires a seperate application pool, running the site outside IIS proved a bit difficult. The profiling worker process is being executed by a service called &amp;quot;ANTS Profiler 3 Server&amp;quot;, so setting the log on identity for this one to the same identity as the application pool used to host the site resolved this issue. You can find the service under Control Panel &amp;gt; Administrative Tools &amp;gt; Services. Here's my setup:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/PerformanceProfilingAndCommerceServer200_14D91/Identity.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="266" alt="Identity" src="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/PerformanceProfilingAndCommerceServer200_14D91/Identity_thumb.jpg" width="237" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Next up, start the profiler from the site, and browse around. When you're done browsing, hit the &amp;quot;Take Snapshop&amp;quot; button in the profiler.&lt;/p&gt;  &lt;h2&gt;The Profiler Results&lt;/h2&gt;  &lt;p&gt;The main window displays slowest lines of code (top) and slowest method (bottom):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/PerformanceProfilingAndCommerceServer200_14D91/AntsProfiler.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="255" alt="AntsProfiler" src="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/PerformanceProfilingAndCommerceServer200_14D91/AntsProfiler_thumb.jpg" width="292" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Looking at the slowest method you can see it's a lot slower than the second slowest! Taking a look at the source method we find the following line, which is the sinner:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/PerformanceProfilingAndCommerceServer200_14D91/AntsProfiler2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="257" alt="AntsProfiler2" src="http://weblogs.asp.net/blogs/lasse/WindowsLiveWriter/PerformanceProfilingAndCommerceServer200_14D91/AntsProfiler2_thumb.jpg" width="294" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;It kind of surprised me that the cause of our slowest methods is a call to the Commerce Server API. We did a lot of additional tests to prove this right, and they all confirmed this issue, even though catalogs are being cached. I would imagine it would have taken a lot of Trace.Writes to find this one. &lt;/p&gt;  &lt;h1&gt;Dllhost.exe Consuming A Lot Of Memory&lt;/h1&gt;  &lt;p&gt;As a side note, we had issues with the dllhost.exe service on the server would consume a lot of memory! After a short visit to Google, it turned out that there's a &lt;a href="http://support.microsoft.com/kb/944900/en-us?spid=11723&amp;amp;sid=1258"&gt;known memory leak in a COM+ component&lt;/a&gt;, causing the dllhost.exe to run wild when performing many catalog imports. We're using BizTalk to import a lot of products, so applying Commerce Server Service Pack 2 should resolve this issue.&lt;/p&gt;  &lt;h1&gt;The Results&lt;/h1&gt;  &lt;p&gt;Fixing the issues mentioned above had a major positive impact on the performance. Other thing we did was:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Improving the algorithm for filtering variants&lt;/li&gt;    &lt;li&gt;Removed some unnessecary calls to the catalog and inventory system&lt;/li&gt;    &lt;li&gt;A bit more caching&lt;/li&gt;    &lt;li&gt;And a lot more&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The server side generation went from ~25 seconds to ~4 seconds the the single heaviest page on the site. With the HTML being all slim, the rendering on the client side improved a lot too.&lt;/p&gt;  &lt;p&gt;Next up is to open up Reflector and SQL Profiler to find out why getting a catalog is such a tough operation, and maybe do a blog post about it, unless &lt;a href="http://blog.brianh.dk/"&gt;Brian&lt;/a&gt; beats me to it...&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6683332" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/LasseEskildsen/~4/vMySEqd-2kU" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/lasse/archive/tags/Performance/default.aspx">Performance</category><category domain="http://weblogs.asp.net/lasse/archive/tags/Commerce+Server/default.aspx">Commerce Server</category><feedburner:origLink>http://weblogs.asp.net/lasse/archive/2008/10/16/performance-profiling-and-commerce-server-2007.aspx</feedburner:origLink></item><item><title>Yet another .NET blogger in town</title><link>http://feedproxy.google.com/~r/LasseEskildsen/~3/f2OSSEipkvs/yet-another-net-blogger-in-town.aspx</link><pubDate>Tue, 30 Sep 2008 20:23:36 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6649066</guid><dc:creator>lasseeskildsen</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/lasse/rsscomments.aspx?PostID=6649066</wfw:commentRss><comments>http://weblogs.asp.net/lasse/archive/2008/09/30/yet-another-net-blogger-in-town.aspx#comments</comments><description>&lt;p&gt;Yes - another .NET related blog for the cloud!&lt;/p&gt;  &lt;p&gt;At any point, a more personal page about me will appear somewhere on this site, but until then I guess a short introduction would be suiteable.&lt;/p&gt;  &lt;p&gt;My name is Lasse and I am a .NET developer from &amp;#197;rhus, Denmark. I work at a company called &lt;a href="http://www.vertica.dk"&gt;Vertica&lt;/a&gt;, where I primarily work with Microsoft Commerce Server, building custom enterprise e-commerce solutions. This blog will evolve around this, and include everything .NET related I stumble upon - problems, solutions and interesting stuff. &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6649066" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/LasseEskildsen/~4/f2OSSEipkvs" height="1" width="1"/&gt;</description><feedburner:origLink>http://weblogs.asp.net/lasse/archive/2008/09/30/yet-another-net-blogger-in-town.aspx</feedburner:origLink></item></channel></rss>
