<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://devlicious.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Mike Nichols - Son Of Nun Technology : ASP.NET</title><link>http://devlicious.com/blogs/mike_nichols/archive/tags/ASP.NET/default.aspx</link><description>Tags: ASP.NET</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>ASP.NET Path With Virtual Directory</title><link>http://devlicious.com/blogs/mike_nichols/archive/2010/06/18/asp-net-path-with-virtual-directory.aspx</link><pubDate>Fri, 18 Jun 2010 15:36:11 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:60637</guid><dc:creator>Michael Nichols</dc:creator><slash:comments>0</slash:comments><comments>http://devlicious.com/blogs/mike_nichols/archive/2010/06/18/asp-net-path-with-virtual-directory.aspx#comments</comments><description>&lt;p&gt;I needed to include a url in a confirmation email from my asp.net app. I am not sure whether it will be deployed to a virtual directory or its own site. Just getting the Authority from the Request will yield no virtual directory, so here’s what i came up with:&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:797a985d-6eb9-4fb8-9ac6-612bcb2e7572" class="wlWriterEditableSmartContent"&gt;&lt;pre style="background-color:White;overflow:auto;"&gt;&lt;span style="color:#0000FF;"&gt;const&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;string&lt;/span&gt;&lt;span style="color:#000000;"&gt; action &lt;/span&gt;&lt;span style="color:#000000;"&gt;=&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Login/Confirm&lt;/span&gt;&lt;span style="color:#800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#000000;"&gt;;
var uri &lt;/span&gt;&lt;span style="color:#000000;"&gt;=&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;new&lt;/span&gt;&lt;span style="color:#000000;"&gt; UriBuilder(HttpContext.Current.Request.Url);
uri.Path &lt;/span&gt;&lt;span style="color:#000000;"&gt;=&lt;/span&gt;&lt;span style="color:#000000;"&gt; VirtualPathUtility.ToAbsolute(&lt;/span&gt;&lt;span style="color:#800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#800000;"&gt;~/&lt;/span&gt;&lt;span style="color:#800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#000000;"&gt;+&lt;/span&gt;&lt;span style="color:#000000;"&gt;action);
uri.Port &lt;/span&gt;&lt;span style="color:#000000;"&gt;=&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#000000;"&gt;-&lt;/span&gt;&lt;span style="color:#800080;"&gt;1&lt;/span&gt;&lt;span style="color:#000000;"&gt;;&lt;/span&gt;&lt;span style="color:#008000;"&gt;//&lt;/span&gt;&lt;span style="color:#008000;"&gt;remove :80 (use default)&lt;/span&gt;&lt;span style="color:#008000;"&gt;
&lt;/span&gt;&lt;span style="color:#000000;"&gt;
var url &lt;/span&gt;&lt;span style="color:#000000;"&gt;=&lt;/span&gt;&lt;span style="color:#000000;"&gt; uri.ToString() &lt;/span&gt;&lt;span style="color:#008000;"&gt;//&lt;/span&gt;&lt;span style="color:#008000;text-decoration:underline;"&gt;http://localhost/myapp/login/confirm&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;There is probably a better way of doing this, but it works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicious.com/aggbug.aspx?PostID=60637" width="1" height="1"&gt;</description><category domain="http://devlicious.com/blogs/mike_nichols/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>Configuring IIS 6.0 to send mail via SMTP for asp.net applications</title><link>http://devlicious.com/blogs/mike_nichols/archive/2008/05/07/configuring-iis-6-0-to-send-mail-via-smtp-for-asp-net-applications.aspx</link><pubDate>Thu, 08 May 2008 05:29:21 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:40371</guid><dc:creator>Michael Nichols</dc:creator><slash:comments>3</slash:comments><comments>http://devlicious.com/blogs/mike_nichols/archive/2008/05/07/configuring-iis-6-0-to-send-mail-via-smtp-for-asp-net-applications.aspx#comments</comments><description>&lt;p&gt;Enabling smtp services for IIS is well documented, but configuring in my environment was more difficult than I would have thought it would be... So this post is partly a note for me as we will be changing out gear soon.&lt;/p&gt;  &lt;p&gt;Our environment is not very exotic...a box acting as an web server, and another box acting as an exchange server. Both are running Win2003. &lt;/p&gt;  &lt;p&gt;First, smtp services must obviously be enabled/running. &lt;a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/e4cf06f5-9a36-474b-ba78-3f287a2b88f2.mspx?mfr=true" target="_blank"&gt;Here is how&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Next, in IIS, select the new SMTP Virtual server node and right-click/Properties/Access/Relay. Be sure &amp;#39;Only the list below&amp;#39; is selected and add &amp;#39;127.0.0.1&amp;#39; (localhost) to your Computers Access list . Finally, deselect &amp;#39;Allow all computers which successfully authenticate...&amp;#39;. Be very careful not to turn your server into a relay server unless you like being blacklisted .&lt;/p&gt;  &lt;p&gt;Now, at this point I was able to get my mail sent to domains outside my own. So if my webserver was webbox.mydomain.com and it sent mail to mygmail@gmail.com then all worked just fine. But I was unable to send mail internally to other mail accounts (mydomain.com). &lt;/p&gt;  &lt;p&gt;What I failed to do was set up a SMART HOST to route mail to my exchange box.&lt;/p&gt;  &lt;p&gt;To do that, right-click the smtp node in iis/Properties/Delivery/Advanced. Enter the name of the server hosting exchange and deselect &amp;#39;attempt direct delivery before sending to smart host&amp;#39;. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicious.com/aggbug.aspx?PostID=40371" width="1" height="1"&gt;</description><category domain="http://devlicious.com/blogs/mike_nichols/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://devlicious.com/blogs/mike_nichols/archive/tags/IIS/default.aspx">IIS</category><category domain="http://devlicious.com/blogs/mike_nichols/archive/tags/Email/default.aspx">Email</category></item><item><title>MonoRail on IIS7 Redux : Configuration And Routing</title><link>http://devlicious.com/blogs/mike_nichols/archive/2008/04/02/monorail-on-iis7-redux-configuration-and-routing.aspx</link><pubDate>Thu, 03 Apr 2008 06:25:02 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:39909</guid><dc:creator>Michael Nichols</dc:creator><slash:comments>0</slash:comments><comments>http://devlicious.com/blogs/mike_nichols/archive/2008/04/02/monorail-on-iis7-redux-configuration-and-routing.aspx#comments</comments><description>&lt;p&gt;A while ago I &lt;a href="http://devlicio.us/blogs/mike_nichols/archive/2007/11/21/monorail-on-iis-7.aspx" target="_blank"&gt;posted&lt;/a&gt; on the very basics about using &lt;a href="http://www.castleproject.org/monorail/"&gt;Monorail&lt;/a&gt; on IIS7. Implementing the routing module requires a bit more tuning though so I wanted to quickly post my configuration and some things to look for if you are having difficulty getting routing going on &lt;a href="http://www.castleproject.org/monorail/"&gt;Monorail&lt;/a&gt;. This is mostly to help those googling and to put all this stuff in one place.&lt;/p&gt;  &lt;p&gt;First, the configuration which &lt;a href="http://abombss.com/" target="_blank"&gt;Adam Tybor&lt;/a&gt; was gracious enough to help me with:&lt;/p&gt;  &lt;div&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:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;configuration&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color:#008000;"&gt;&amp;lt;!--...--&amp;gt;&lt;/span&gt;
&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;system.webServer&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;modules&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;add&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;routingEx&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;type&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Castle.MonoRail.Framework.Routing.RoutingModuleEx,Castle.MonoRail.Framework&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;preCondition&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;managedHandler&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;add&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;PerRequestLifestyle&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;type&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule,Castle.MicroKernel&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;preCondition&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;managedHandler&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;            
        &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;modules&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;handlers&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;accessPolicy&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Script, Execute, Read&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;clear&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;add&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ASPX&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;path&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;*.aspx&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;verb&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;*&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;type&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;System.Web.UI.PageHandlerFactory&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;resourceType&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Unspecified&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;preCondition&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;integratedMode&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;            
            &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;add&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Block-Boo&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;path&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;*.boo&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;verb&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;*&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;type&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;System.Web.HttpForbiddenHandler, System.Web&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;modules&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ManagedPipelineHandler&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;scriptProcessor&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;resourceType&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Unspecified&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;requireAccess&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Script&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;preCondition&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;integratedMode,runtimeVersionv2.0&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;add&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Block-Brail-JS&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;path&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;*.brailjs&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;verb&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;*&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;type&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;System.Web.HttpForbiddenHandler, System.Web&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;modules&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ManagedPipelineHandler&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;scriptProcessor&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;resourceType&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Unspecified&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;requireAccess&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Script&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;preCondition&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;integratedMode,runtimeVersionv2.0&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;add&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Block-Brail&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;path&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;*.brail&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;verb&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;*&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;type&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;System.Web.HttpForbiddenHandler, System.Web&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;modules&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ManagedPipelineHandler&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;scriptProcessor&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;resourceType&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Unspecified&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;requireAccess&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Script&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;preCondition&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;integratedMode,runtimeVersionv2.0&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;add&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Monorail-All&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;path&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;*&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;verb&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;*&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;type&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Castle.MonoRail.Framework.MonoRailHttpHandlerFactory, Castle.MonoRail.Framework&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;modules&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ManagedPipelineHandler&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;scriptProcessor&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;resourceType&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Unspecified&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;requireAccess&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Script&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;preCondition&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
            
            
        &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;handlers&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;validation&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;validateIntegratedModeConfiguration&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;system.webServer&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;configuration&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;If the &amp;#39;system.webServer&amp;#39; node doesn&amp;#39;t look familiar to you, go read the previous post to get up to speed on how IIS7 looks at your config files. &lt;/p&gt;

&lt;p&gt;It is important to note that this configuration &amp;lt;clear/&amp;gt;s all the handler mappings from IIS7 and only implements what is required. Not doing so will prevent the routing module from doing it magic...I am still not sure why even after removing my StaticFile handler I was unable to get my routing module to work, but I looked through all the IIS7 trace logs and it appeared one of the many modules mapped by default was preventing RoutingEx from handling the request.&lt;/p&gt;

&lt;p&gt;Another important thing to note is that this configuration would pass &lt;em&gt;all &lt;/em&gt;requests through the monorail module which obviously will be less-than-optimal for static content. You can read more about implementing a best practice to handle this &lt;a href="http://www.castleproject.org/monorail/documentation/trunk/advanced/routing.html#anotherapproach" target="_blank"&gt;here&lt;/a&gt; .&amp;#160; Basically, you are just setting up another website with stripped down handler mappings either on IIS or some faster server to deliver static content. I have loved separating this kind of stuff out of my web projects as it lets me centralize all the common scripts/images AND speed up my sites.&lt;/p&gt;

&lt;p&gt;A minor note, too, is that I am passing *.aspx calls to the PageHandlerFactory. This is simply to use some server controls on an aspx page or two I need to use that require normal webforms handling (with ViewState darkness and Event Model Labyrinths ). I&amp;#39;ll be posting more on that setup later...&lt;/p&gt;

&lt;p&gt;Other Resources:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://hammett.castleproject.org/?p=216" target="_blank"&gt;Hammett&amp;#39;s post on routing&lt;/a&gt;&lt;/li&gt;

  &lt;li&gt;&lt;a href="http://hammett.castleproject.org/?p=231" target="_blank"&gt;Hammett&amp;#39;s post on IIS7 issues&lt;/a&gt;&lt;/li&gt;

  &lt;li&gt;&lt;a href="http://www.galcho.com/Blog/PermaLink.aspx?guid=490f3c31-1815-40fc-a871-5d6899fa35e0" target="_blank"&gt;Caching static content on IIS7&lt;/a&gt;&lt;/li&gt;

  &lt;li&gt;&lt;a href="http://devlicio.us/blogs/mike_nichols/archive/2007/11/21/monorail-on-iis-7.aspx" target="_blank"&gt;Basics on setting up IIS7 for monorail&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicious.com/aggbug.aspx?PostID=39909" width="1" height="1"&gt;</description><category domain="http://devlicious.com/blogs/mike_nichols/archive/tags/Castle+Project/default.aspx">Castle Project</category><category domain="http://devlicious.com/blogs/mike_nichols/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://devlicious.com/blogs/mike_nichols/archive/tags/Monorail/default.aspx">Monorail</category><category domain="http://devlicious.com/blogs/mike_nichols/archive/tags/IIS/default.aspx">IIS</category></item><item><title>Page Lifecycle Study : Part One- The Project</title><link>http://devlicious.com/blogs/mike_nichols/archive/2007/10/04/page-lifecycle-study-part-one-the-project.aspx</link><pubDate>Thu, 04 Oct 2007 08:04:53 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:38597</guid><dc:creator>Michael Nichols</dc:creator><slash:comments>9</slash:comments><comments>http://devlicious.com/blogs/mike_nichols/archive/2007/10/04/page-lifecycle-study-part-one-the-project.aspx#comments</comments><description>&lt;p&gt;This is one of those posts that pains me to write. I blame Monorail for the pain that I am now acutely aware of in working with the Web Forms model in ASP.NET. But that&amp;#39;s a whole other post...&lt;/p&gt; &lt;p&gt;Dealing with the events that take place in the lifetime of a Page in WebForms is tricky once you get beyond the demo samples. Dynamic loading of controls based on state, collection control (ie, Repeater) value persistence between postbacks, and event timing of web controls immediately reveal to the excited &amp;quot;look I can drag a GridView and see my employees table&amp;quot; developer that he has just stepped in a big pile of over-architecture and got bizarre form behavior all over him.&amp;nbsp; &lt;/p&gt; &lt;p&gt;&lt;a href="http://devlicio.us/blogs/mike_nichols/WindowsLiveWriter/PageLifecycleStudy_30B/steppedonit.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="180" alt="steppedonit" src="http://devlicio.us/blogs/mike_nichols/WindowsLiveWriter/PageLifecycleStudy_30B/steppedonit_thumb.png" width="240" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;And that is with ViewState &lt;strong&gt;ON&lt;/strong&gt;.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;A &lt;a href="http://blechie.com/WPierce/Default.aspx" target="_blank"&gt;wise blogger&lt;/a&gt; once wrote &lt;a href="http://blogs.meetandplay.com/WPierce/archive/2006/12/14/ViewState_is_the_Devil.aspx" target="_blank"&gt;ViewState is the devil&lt;/a&gt;&amp;nbsp;and shortly after that I was checking out &lt;a href="http://scottwater.com/blog/archive/asp-net-state-management-tips/" target="_blank"&gt;Scott Watermasysk&amp;#39;s ASP.NET tips&lt;/a&gt;&amp;nbsp;and dealing with bloated pages in my own application...I was encouraged to turn ViewState OFF and deal with the consequences. I really HAD to since my ViewState had gotten out of control. &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;As if that didn&amp;#39;t complicate matters enough, I was using the Model-View-Presenter pattern and wrestled with how to implement this with a stateless view (more or less) that has a complex&amp;nbsp;strategy&amp;nbsp;for restoring values from the Request.Form collection while making the view the entry point for requests, thus seemingly forcing my Presenter/Controller into submission to the famed ASP.NET Page Lifecycle...something I was hoping to avoid.&lt;/p&gt; &lt;p&gt;I decided it was time to&amp;nbsp;just&amp;nbsp;isolate all this&amp;nbsp;and create a test bed where I could discover exactly what is happening when with actual controls and get feedback from this monster to tell me what it demands for me to simply pass data back and forth in a text stream. So I created this simple project that has quite a bit of sample data and different ways to see events firing during the postbacks. Controls like the Repeater and DropDownList are absolutely non-intuitive once ViewState is OFF and so are worth a close look on how to persist values. Also, the event handling of simple controls like the TextBox require some deeper understanding once you turn ViewState off. &lt;/p&gt; &lt;p&gt;I simply had quite a bit of difficulty finding actual code that showed things happening at different times when I was first swimming in the sea of events ASP.NET offers...all I could find were pretty diagrams and lots of code jammed in Page_Load with the occasional exotic mention of the &amp;#39;catch-up&amp;#39; performed by controls upon Controls.Add to the control hierarchy.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;So for this first post, &lt;a href="http://devlicio.us/blogs/mike%5Fnichols/downloads/PageLifecycleStudy.zip" target="_blank"&gt;here is the project&lt;/a&gt;&amp;nbsp;. &lt;/p&gt; &lt;p&gt;&lt;strong&gt;DISCLAIMER: It&amp;#39;s not pretty, but rather could maybe be useful for people who are confused about what is happening in their pages or to teach others.&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;I have since settled down quite a bit regarding how I prefer to implement MVP since I created this. I&amp;#39;ll post more on what I do with MVP in the future.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicious.com/aggbug.aspx?PostID=38597" width="1" height="1"&gt;</description><category domain="http://devlicious.com/blogs/mike_nichols/archive/tags/featured/default.aspx">featured</category><category domain="http://devlicious.com/blogs/mike_nichols/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item></channel></rss>