<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Liam McLennan</title>
        <link>http://geekswithblogs.net/liammclennan/Default.aspx</link>
        <description>blog</description>
        <language>en-US</language>
        <copyright>Liam McLennan</copyright>
        <managingEditor>liam@eclipsewebsolutions.com.au</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Liam McLennan</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/liammclennan/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>ASP.NET MVC - Validate Request</title>
            <link>http://geekswithblogs.net/liammclennan/archive/2008/09/16/125219.aspx</link>
            <description>Since .NET 2.0 Asp.net webforms has protected the programmer from cross-site scripting by validating all input sent to the server. Unfortunately, this does not happen in Asp.net mvc. I tested my application by typing 'alert("xss");' surrounded by script tags in the first name textbox. The form saved successfully and I got a javascript alert box with the message "xss".   &lt;br /&gt;
&lt;br /&gt;
In asp.net mvc it is the programmers responsibility to validate all input. Calling Request.ValidateInput() in a controller tells the framework that any values read from the request should be validated. If an invalid character is found a HttpRequestValidationException is thrown.  &lt;br /&gt;
&lt;br /&gt;
Here is an example implementation:           &lt;br /&gt;
&lt;pre&gt;    Request.ValidateInput();                  &lt;br /&gt;    try { UpdateModel(b, new[] { "FirstName", "LastName", "Email" }); }         &lt;br /&gt;    catch (HttpRequestValidationException) { /* Handle request validation error  */ }  &lt;/pre&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125219"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125219" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/liammclennan/aggbug/125219.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Liam McLennan</dc:creator>
            <guid>http://geekswithblogs.net/liammclennan/archive/2008/09/16/125219.aspx</guid>
            <pubDate>Wed, 17 Sep 2008 01:42:35 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/liammclennan/comments/125219.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/liammclennan/archive/2008/09/16/125219.aspx#feedback</comments>
            <slash:comments>9</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/liammclennan/comments/commentRss/125219.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/liammclennan/services/trackbacks/125219.aspx</trackback:ping>
        </item>
        <item>
            <title>ASP.NET MVC - Beautifying Views</title>
            <link>http://geekswithblogs.net/liammclennan/archive/2008/09/04/124956.aspx</link>
            <description>This is a simple technique I recently started using to clean up MVC views. &lt;br /&gt;
&lt;br /&gt;
Here was my first attempt at rendering a list of alerts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class="tabTable"&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;VEHICLE&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;ALERT TYPE&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;WHEN&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;ACT&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;%&lt;br /&gt;
    foreach (FleetAlertDTO alert in ViewData.Model)&lt;br /&gt;
    {&lt;br /&gt;
%&amp;gt;        &lt;br /&gt;
        &amp;lt;%= Html.RenderUserControl("~/Views/Alert/FleetAlert.ascx", alert) %&amp;gt;&lt;br /&gt;
&amp;lt;%&lt;br /&gt;
    }    &lt;br /&gt;
%&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I didn't like it because there are to many &amp;lt;% %&amp;gt;. Using Response.Write() can help eliminate much of the switching between html and C#. Here is what I ended up with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class="tabTable"&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;th&amp;gt;&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;VEHICLE&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;ALERT TYPE&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;WHEN&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;ACT&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;%&lt;br /&gt;
    foreach (FleetAlertDTO alert in ViewData.Model)&lt;br /&gt;
    {&lt;br /&gt;
        Response.Write(Html.RenderUserControl("~/Views/Alert/FleetAlert.ascx", alert));&lt;br /&gt;
    }    &lt;br /&gt;
%&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
It's a simple change, but I think it is much more readable.&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124956"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124956" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/liammclennan/aggbug/124956.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Liam McLennan</dc:creator>
            <guid>http://geekswithblogs.net/liammclennan/archive/2008/09/04/124956.aspx</guid>
            <pubDate>Fri, 05 Sep 2008 04:22:29 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/liammclennan/comments/124956.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/liammclennan/archive/2008/09/04/124956.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/liammclennan/comments/commentRss/124956.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/liammclennan/services/trackbacks/124956.aspx</trackback:ping>
        </item>
        <item>
            <title>Stackoverflow.com - The Jeff Atwood Joel Spolsky marketing machine</title>
            <link>http://geekswithblogs.net/liammclennan/archive/2008/08/25/124682.aspx</link>
            <description>Stackoverflow.com is a soon-to-be-released developer community website from Jeff Atwood and Joel Spolsky. It is an evolution of existing sites in the genre, adding reddit and wiki type features to the traditional forum style site. &lt;br /&gt;
&lt;br /&gt;
The technology stack it uses is nearly identical to my current personal project: Asp.Net MVC, jQuery, Linq-to-sql, sql 2005. The truly fascinating thing about stackoverflow.com is the buzz. There are already thousands of users on the private beta. I predict, and Joel Spolsky concurrs, that when it goes live it will be huge. Not because its a great site, which it is, but because of the spectacular Atwood/Spolsky marketing machine. These two gentleman have enourmous credibility in the developer community and it shows in the early success of their new joint venture. It is a perfect demonstration of how online reputation is an asset and how to leverage that asset into a business that makes money. &lt;br /&gt;
&lt;br /&gt;
My final prediction is that their server will crash in the first week of go-live. It will be karma's revenge for making fun of twitter.&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124682"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124682" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/liammclennan/aggbug/124682.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Liam McLennan</dc:creator>
            <guid>http://geekswithblogs.net/liammclennan/archive/2008/08/25/124682.aspx</guid>
            <pubDate>Tue, 26 Aug 2008 02:54:12 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/liammclennan/comments/124682.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/liammclennan/archive/2008/08/25/124682.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/liammclennan/comments/commentRss/124682.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/liammclennan/services/trackbacks/124682.aspx</trackback:ping>
        </item>
        <item>
            <title>American Gangster</title>
            <link>http://geekswithblogs.net/liammclennan/archive/2008/08/20/124566.aspx</link>
            <description>Americal Gangster is an excellent film. My feelings about it are shared by the first imdb commenter, "I can hardly believe that this amazing package of a story was delivered by Ridley Scott". Highly recommended.&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124566"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124566" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/liammclennan/aggbug/124566.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Liam McLennan</dc:creator>
            <guid>http://geekswithblogs.net/liammclennan/archive/2008/08/20/124566.aspx</guid>
            <pubDate>Wed, 20 Aug 2008 08:54:18 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/liammclennan/comments/124566.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/liammclennan/archive/2008/08/20/124566.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/liammclennan/comments/commentRss/124566.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/liammclennan/services/trackbacks/124566.aspx</trackback:ping>
        </item>
        <item>
            <title>Reasons why Vista is great for a Web Application Development Machine</title>
            <link>http://geekswithblogs.net/liammclennan/archive/2008/08/07/124302.aspx</link>
            <description>&lt;span style="font-weight: bold;"&gt;1. IIS 7 Allows Multiple Web Sites&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
On XP IIS was limited to one web site. To develop multiple web site one had to use virtual directories or develop solely with Cassini (VS Web server). The problem with both of the aforementioned strategies is that they create a significant difference between the development and production web servers. I prefer to develop with IIS, and Vista allows me to do that. &lt;br /&gt;
&lt;br style="font-weight: bold;" /&gt;
&lt;span style="font-weight: bold;"&gt;2. IIS 7 Plays Well with Asp.Net MVC&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I love Asp.Net MVC but it really does not work well without IIS 7. &lt;br /&gt;
&lt;br style="font-weight: bold;" /&gt;
&lt;span style="font-weight: bold;"&gt;3. Vista works with my hardware&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Most of my development work is done on my Dell Inspiron 6400, which had loads of driver issues that I never resolved when I was running XP Pro. Vista Business just works.&lt;br /&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124302"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124302" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/liammclennan/aggbug/124302.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Liam McLennan</dc:creator>
            <guid>http://geekswithblogs.net/liammclennan/archive/2008/08/07/124302.aspx</guid>
            <pubDate>Thu, 07 Aug 2008 23:28:29 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/liammclennan/comments/124302.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/liammclennan/archive/2008/08/07/124302.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/liammclennan/comments/commentRss/124302.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/liammclennan/services/trackbacks/124302.aspx</trackback:ping>
        </item>
        <item>
            <title>Subversion (SVN) Clients</title>
            <link>http://geekswithblogs.net/liammclennan/archive/2008/07/02/123530.aspx</link>
            <description>Subversion is a version control server. To use subversion you need a subversion client. There are many available, including a command line client, free gui clients and commercial clients.&lt;br /&gt;
&lt;br /&gt;
When recommending subversion for source code control nearly everyone seems to recommed &lt;a href="http://tortoisesvn.tigris.org/"&gt;TortoiseSVN &lt;/a&gt;as the client program. TortoiseSVN is a windows shell extension that allows subversion to be used via the Windows Explorer context menu. One thing I love about it is that it integrates effortlessly with IDEs/editors that use the windows shell as their file browser (such as e). Unfortunately, Visual Studio does not use the windows shell so you don't automatically get TortoiseSVN integration.&lt;br /&gt;
&lt;br /&gt;
I have recently dumped TortoiseSVN for the following reasons:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;the interface is clunky. Everything seems to require more dialogs and clicks than it should. &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;the synchronization with the windows shell is slow. When files are commited they often remain marked as modified for several minutes until the synchronization catches up.&lt;/li&gt;
    &lt;li&gt;TortoiseSVN is resource intensive. Once again I think this may have to do with the shell integration. Both CPU and memory usage are relatively high. &lt;br /&gt;
    &lt;/li&gt;
&lt;/ul&gt;
An alternative to TortoiseSVN is &lt;a href="http://rapidsvn.tigris.org/"&gt;RapidSVN&lt;/a&gt;. RapidSVN is a more traditional GUI source control client. The downside of this is that you will usually need to have the RapidSVN gui open as well as your IDE when developing. What I like about RapidSVN is that it is less resource intensive and quick to use that TortoiseSVN. What I dont like about it is that it does not show the list of non-versioned files when commiting like TortoiseSVN does. &lt;br /&gt;
&lt;br /&gt;
TortoiseSVN and RapidSVN are both fantastic free SVN clients. The purpose of this post is to address what I feel is an unjustified bias towards TortoiseSVN. When selecting a subversion client be sure to take a look at other alternatives, including TortoiseSVN.&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123530"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123530" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/liammclennan/aggbug/123530.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Liam McLennan</dc:creator>
            <guid>http://geekswithblogs.net/liammclennan/archive/2008/07/02/123530.aspx</guid>
            <pubDate>Wed, 02 Jul 2008 07:43:44 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/liammclennan/comments/123530.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/liammclennan/archive/2008/07/02/123530.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/liammclennan/comments/commentRss/123530.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/liammclennan/services/trackbacks/123530.aspx</trackback:ping>
        </item>
        <item>
            <title>Upgrading to Asp.Net MVC Preview 3</title>
            <link>http://geekswithblogs.net/liammclennan/archive/2008/06/07/122699.aspx</link>
            <description>When Asp.net AJAX was about to be born I was an early adopter. I dutifully downloaded each new preview and upgraded my solution to handle the API changes. This experience taught me that living on the edge is a world of pain. Each new release could mean hours of wasted time, just to get back to where I started. &lt;br /&gt;
&lt;br /&gt;
Since then I have avoided working with pre-release software - until Asp.Net MVC came along looking too good to refuse. So now I am back in the familiar cycle of responding to preview releases. I knew the upgrade to preview 3 would be a tough one just by looking at the forum traffic it generated. This release includes a lot of changes. But since I had already skipped an interim code drop I decided that I could not afford to delay any longer. As bad as these upgrades are they are even worse if you skip a release. &lt;br /&gt;
&lt;br /&gt;
The upgrade was complicated by MVCContrib, which is versioned to match Asp.Net MVC, meaning that when MVC is upgraded MVCContrib must also be upgraded. Here I re-learned an important lesson about MVCContrib. There is almost no documentation, but there are excellent sample applications distributed with the source. Had I looked in the sample application to begin with I would have saved hours of trying to work out how to get the new MVCContrib to work with Castle Windsor. &lt;br /&gt;
&lt;br /&gt;
The other changes were straight forward. All of the controller actions had to be changed to return an ActionResult, which I think is an excellent change. All of the Html helpers for drop-down lists and list boxes have also changed. The old API for these was definately a weak spot and I like the new API much better. Finally, strongly typed view data is now available in the views as ViewData.Model instead of just ViewData so that meant a lot of simple changes. &lt;br /&gt;
&lt;br /&gt;
Now that I am finished the upgrade appears to have been a success. I have all the latest-and-greatest goodness and my application is still working.&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122699"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122699" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/liammclennan/aggbug/122699.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Liam McLennan</dc:creator>
            <guid>http://geekswithblogs.net/liammclennan/archive/2008/06/07/122699.aspx</guid>
            <pubDate>Sun, 08 Jun 2008 04:44:02 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/liammclennan/comments/122699.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/liammclennan/archive/2008/06/07/122699.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/liammclennan/comments/commentRss/122699.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/liammclennan/services/trackbacks/122699.aspx</trackback:ping>
        </item>
        <item>
            <title>Implementing the Repository Pattern with Linq-to-Sql</title>
            <link>http://geekswithblogs.net/liammclennan/archive/2008/06/05/122653.aspx</link>
            <description>I had too much content for a blog post, so I posted a full article to code project: &lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.codeproject.com/KB/architecture/linqrepository.aspx"&gt;http://www.codeproject.com/KB/architecture/linqrepository.aspx&lt;/a&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122653"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122653" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/liammclennan/aggbug/122653.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Liam McLennan</dc:creator>
            <guid>http://geekswithblogs.net/liammclennan/archive/2008/06/05/122653.aspx</guid>
            <pubDate>Thu, 05 Jun 2008 23:36:43 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/liammclennan/comments/122653.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/liammclennan/archive/2008/06/05/122653.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/liammclennan/comments/commentRss/122653.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/liammclennan/services/trackbacks/122653.aspx</trackback:ping>
        </item>
        <item>
            <title>JAOO Brisbane - Day 3</title>
            <link>http://geekswithblogs.net/liammclennan/archive/2008/05/31/122521.aspx</link>
            <description>I began the third and final day of JAOO Brisbane by arriving late. I had left my name tag at home so I had to go back for it. &lt;br /&gt;
&lt;br /&gt;
I was in time for Robert Martin's keynote Clean Code. Uncle Bob is well known for his enthusiastic, entertaining presentation style. I greatly enjoyed his talk, even though it was really just a back-to-basics on writing code. He did a tutorial on advanced design that I missed, but I'm sure it would have been excellent. &lt;br /&gt;
&lt;br /&gt;
Next was Jim Webber speaking about distributed programming using the internet. Jim is also an excellent and insightful speaker. I enjoyed the talk even though I don't particularly care about the topic. He talked about WS-* and described an approach for using RESTful services. &lt;br /&gt;
&lt;br /&gt;
Before lunch Gregor Hohpe spoke about some of the new services offered by google. Things like GData, Google Apps, and Google Mashup editor. I did not get much from the talk because I am not interested in those tools. It seemed like a really bad way to make software. &lt;br /&gt;
&lt;br /&gt;
After lunch Robert Martin spoke about functions. Because the talks are limited to 45 minutes they work best when the speaker focuses on one small aspect - such as functions. I got some good ideas from the talk that I will be trying to implement.&lt;br /&gt;
&lt;br /&gt;
After a short break I was back to listen to Michael Feathers talk about designing testable APIs. This is a topic that is very close to Michael's heart, but it seemed that some of the audience did not feel it was relevant (so why did they come?). I learnt some things and will definately keep unit testing in mind when designing APIs.&lt;br /&gt;
&lt;br /&gt;
Finally, Eric Dornenburg gave us his thoughts on Software Quality - specifically how to use visualazation tools to provide feedback on software quality. Some interesting metrics came up and I will be looking for some tools for .NET when I get the chance. He showed thought works toxicity chart which I thought was particularly interesting. It basically provided a way to measure the health of an application, broken down by class. I wish that it was available to the public. &lt;br /&gt;
&lt;br /&gt;
After Eric's talk there was some time for socialising and meeting the speakers. Because the conference was nice and small (~200) I was able to have a chat with most of the speakers which was nice. Overall the JAOO experience was very positive and I have already signed up for next year.&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122521"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122521" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/liammclennan/aggbug/122521.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Liam McLennan</dc:creator>
            <guid>http://geekswithblogs.net/liammclennan/archive/2008/05/31/122521.aspx</guid>
            <pubDate>Sat, 31 May 2008 23:15:29 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/liammclennan/comments/122521.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/liammclennan/archive/2008/05/31/122521.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/liammclennan/comments/commentRss/122521.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/liammclennan/services/trackbacks/122521.aspx</trackback:ping>
        </item>
        <item>
            <title>JAOO Brisbane 2008 - Day 2</title>
            <link>http://geekswithblogs.net/liammclennan/archive/2008/05/29/122484.aspx</link>
            <description>The conference proper began with a faux improvised discussion about the conference. There were some attempts at humour, which I appreciate, but they struggled. &lt;br /&gt;
&lt;br /&gt;
Eric Meijer from Microsoft had the first keynote. His central theme was that imperative OO programming is fatally flawed and we should all embrace functional programming. His presentation was entertaining and thought provoking. &lt;br /&gt;
&lt;br /&gt;
The next talk I chose to attend was by Dave Thomas (not the Pragmattic Dave Thomas) on the topic of next generation IT. I felt like Dave enjoyed giving this talk because it allowed him to look a long way into the future and present his strong opinions. I did not agree with everything he said but I appreciate that he was not afraid to express an opinion, in an industry dominated by fence-sitters.&lt;br /&gt;
&lt;br /&gt;
The last talk I sqeezed in before lunch was Lessons Learned from Architecture Reviews by Rebecca Wirfs-Brock. Unfortunately for me, this was mostly a repeat of the content I heard Rebecca discuss in a podcast from last year. Even so it was a good refresher containing lots of practical advice for handling both sides of an architecture review.&lt;br /&gt;
&lt;br /&gt;
After lunch it was Enterprise Patterns with Martin Fowler. This was really old news for me. In the forty-five minute session he had just time to cover what are patterns and what are enterprise patterns.&lt;br /&gt;
&lt;br /&gt;
Next up was Don Syme from Microsoft introducing F#. Don is a local boy who now works for Microsoft research in Cambridge. Once again the 45 minute limit really prevented this talk from getting very deep at all. Mostly he just demonstrated running some scripts and discussed some of the properties of the language. He had lots of slides that we never got to. &lt;br /&gt;
&lt;br /&gt;
After Don it was back to Dave Thomas; this time speaking about introducing agile processes into large organisations. On suprise for me was that Dave made a point that agile development does not lead to business agility - when I thought that was sort of the point. My other observation is that Dave seems to be frustrated with the state of the art. He suggested in his earlier talk that user generated applications are the way of the future. I think he needs to have a look at No Silver Bullet (Brooks).&lt;br /&gt;
&lt;br /&gt;
The last session before the keynote was a panel on Enterprise Systems. It was a little strange because they began the discussion without introducing the speakers. I for one had no idea who most of them were (though I later met some of them at the bar). The panel was enjoyable and actually something of a highlight for me. It was clear that most, if not all, of the panel had carefully considered viewpoints on the topic. Product plugging was kept to a minimum.&lt;br /&gt;
&lt;br /&gt;
The last session of the day was Eric Dornenburg and Martin Fowler's keynote simply titled Simplicity in Design. It was ok. The themes were: simplicity is good, complexity is bad. There was an interesting exploration of the notion of technical debt.&lt;br /&gt;
&lt;br /&gt;
After the keynote the majority of the attendees and speakers made our way to the Belgian Beer Cafe for the social event. This was a great chance to meet some people to discuss the conference and exchange ideas. I am looking forward to Robert Martin's talks tomorrow.&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122484"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122484" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/liammclennan/aggbug/122484.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Liam McLennan</dc:creator>
            <guid>http://geekswithblogs.net/liammclennan/archive/2008/05/29/122484.aspx</guid>
            <pubDate>Thu, 29 May 2008 21:56:55 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/liammclennan/comments/122484.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/liammclennan/archive/2008/05/29/122484.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/liammclennan/comments/commentRss/122484.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/liammclennan/services/trackbacks/122484.aspx</trackback:ping>
        </item>
        <item>
            <title>JAOO Brisbane 2008</title>
            <link>http://geekswithblogs.net/liammclennan/archive/2008/05/28/122461.aspx</link>
            <description>Yesterday was the first day of JAOO Brisbane 2008. Choosing tutorials was hard. Should I learn from Rebecca Wirfs-Brock about telling design stories, or Robert Martin about agile O-O design? I chose to attend the Martin Fowler and Erik Dornenburg tutorial on test driven development. It was a full day tutorial so it meant I missed out on the other tutorials. &lt;br /&gt;
&lt;br /&gt;
As someone who is familiar with test-driven development I was hoping for some expert insight beyond just an explanation of the basic red-green-refactor process. I liked the way that they related test-driven development to the values of XP. &lt;br /&gt;
&lt;br /&gt;
SIMPLICITY: Tests narrow focus and help to avoid speculative generality.&lt;br /&gt;
COMMUNICATION: Tests help drive the design of clear interfaces and also serve as documentation of the interface.&lt;br /&gt;
FEEDBACK: Tests provide nearly immediate, and unarguable feedback about the correctness of the code they test.&lt;br /&gt;
COURAGE: Tests give a reason to act with courage. This was contrasted with the smalltalk community who apparently had courage without discipline.&lt;br /&gt;
&lt;br /&gt;
To introduce the example application they used story cards. Something new for me was the following formula for writing stories:&lt;br /&gt;
&lt;br /&gt;
As a ________ I would like to be able to ___________ so that ____________.&lt;br /&gt;
&lt;br /&gt;
This seems like a good formula and I will certainly be giving it a try on my projects. &lt;br /&gt;
&lt;br /&gt;
There was quite a look of talk using the language of Eric Evan's Domain-driven design. We were encouraged to refactor variable and class names to match the ubiquitous language and to use immutable value objects.&lt;br /&gt;
&lt;br /&gt;
There is no substitue for an experienced teacher and although there was really no new content for me I feel that it was worthwhile. A book can present rules but without a quality teacher it is difficult to know how to apply the rules and in particular how dogmattic to be. I am looking forward to some great talks today.&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122461"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122461" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/liammclennan/aggbug/122461.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Liam McLennan</dc:creator>
            <guid>http://geekswithblogs.net/liammclennan/archive/2008/05/28/122461.aspx</guid>
            <pubDate>Wed, 28 May 2008 21:52:29 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/liammclennan/comments/122461.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/liammclennan/archive/2008/05/28/122461.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/liammclennan/comments/commentRss/122461.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/liammclennan/services/trackbacks/122461.aspx</trackback:ping>
        </item>
        <item>
            <title>Restricting HTTP methods with an Asp.net MVC ActionFilter</title>
            <link>http://geekswithblogs.net/liammclennan/archive/2008/05/21/122299.aspx</link>
            <description>HTTP methods are not often thought about when coding Asp.net webforms applications. Links are GETs, buttons are POSTs and it all happens automatically. With Asp.NET MVC, and other MVC frameworks like Rails, the HTTP method used is more obvious and developers are begining to care about which they use. &lt;br /&gt;
&lt;br /&gt;
The problem is that GET requests tell visitors to your site, including search engines, client-side web optimizers and other automatic tools, that it is safe to make the request. Which is a problem if your checkout button causes a GET. To quote Dave Thomas, paraphrasing Tim Berners-Lee, "Use GET requests to retrieve information from the server, and use POST requests to request a change of state on the server".&lt;br /&gt;
&lt;br /&gt;
To help me correctly control which HTTP methods are used to access my controller actions I created an ActionFilterAttribute. ActionFilters provide a declarative way to access the executing context immediately prior to, and immediately following, the execution of an action. They are an excellent way to introduce aspect oriented programming to an asp.net mvc application. To use my action filter you attribute a controller action like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="csharpcode"&gt;[AllowedHttpMethods(AllowedMethods= &lt;span class="kwrd"&gt;new&lt;/span&gt; HttpMethods[] {HttpMethods.POST})]&lt;br /&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Save()&lt;br /&gt;{ ... }&lt;br /&gt;&lt;/pre&gt;
The code for the Action Filter inherits from ActionFilterAttribute and overrides the OnActionExecuting event.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; AllowedHttpMethodsAttribute : ActionFilterAttribute&lt;br /&gt;    {&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; HttpMethods[] AllowedMethods { get; set; }&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnActionExecuting(FilterExecutingContext filterContext)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;int&lt;/span&gt; count = AllowedMethods.Count(m =&amp;gt; m.ToString().Equals(filterContext.HttpContext.Request.HttpMethod));&lt;br /&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (count == 0) &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; Exception(&lt;span class="str"&gt;"Invalid http method: "&lt;/span&gt; + filterContext.HttpContext.Request.HttpMethod);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;enum&lt;/span&gt; HttpMethods&lt;br /&gt;    {&lt;br /&gt;        GET,POST&lt;br /&gt;    }&lt;/pre&gt;
&lt;br /&gt;
By adding the AllowedHttpMethods attribute to all of my controller actions I can assure that http methods are used correctly.&lt;br /&gt;
&lt;br /&gt;
I also use an action filter attribute to authorize which roles can access with actions. The technique I used is based upon the article &lt;a href="http://blog.wekeroad.com/blog/aspnet-mvc-securing-your-controller-actions/"&gt;Securing Your Controller Actions&lt;/a&gt; by Rob Conery.&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122299"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122299" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/liammclennan/aggbug/122299.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Liam McLennan</dc:creator>
            <guid>http://geekswithblogs.net/liammclennan/archive/2008/05/21/122299.aspx</guid>
            <pubDate>Thu, 22 May 2008 02:59:13 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/liammclennan/comments/122299.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/liammclennan/archive/2008/05/21/122299.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/liammclennan/comments/commentRss/122299.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/liammclennan/services/trackbacks/122299.aspx</trackback:ping>
        </item>
        <item>
            <title>How to Generate URLs with ASP.NET MVC</title>
            <link>http://geekswithblogs.net/liammclennan/archive/2008/05/21/122298.aspx</link>
            <description>I have been working with ASP.NET MVC for some time and yet I still had trouble trying to generate a URL in a view. URL generation is particularly important for ASP.NET MVC because it uses a routing engine to map URLs to code. If we hard code a URL then we lose the ability to later vary our routing scheme.&lt;br /&gt;
&lt;br /&gt;
I have found two ways that currently (ASP.NET MVC preview 2) work to generate URLs in a view. The first uses the GetVirtualPath method and seems overly complicated - so I wrapped it in a global helper:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; GenerateUrl(HttpContext context, RouteValueDictionary routeValues)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; RouteTable.Routes.GetVirtualPath(&lt;br /&gt;                &lt;span class="kwrd"&gt;new&lt;/span&gt; RequestContext(&lt;span class="kwrd"&gt;new&lt;/span&gt; HttpContextWrapper2(context), &lt;span class="kwrd"&gt;new&lt;/span&gt; RouteData()),&lt;br /&gt;                routeValues).ToString();&lt;br /&gt;        }&lt;/pre&gt;
But then I found that I could achieve the same result more simply using UrlHelper, accessible via the Url property of the view. &lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;// link to a controller&lt;/span&gt; &lt;br /&gt;Url.Action(&lt;span class="str"&gt;"Home"&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;// link to an action&lt;/span&gt; &lt;br /&gt;Url.Action(&lt;span class="str"&gt;"Home"&lt;/span&gt;, &lt;span class="str"&gt;"Index"&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;// link to an action and send parameters&lt;/span&gt; &lt;br /&gt;Url.Action(&lt;span class="str"&gt;"Edit"&lt;/span&gt;, &lt;span class="str"&gt;"Product"&lt;/span&gt;, &lt;span class="kwrd"&gt;new&lt;/span&gt; RouteValueDictionary(&lt;span class="kwrd"&gt;new&lt;/span&gt; { id = p.Id }));&lt;/pre&gt;
Or, if you want the url for a hyperlink you can get that in one step using the ActionLink method on the Html property:
&lt;pre class="csharpcode"&gt;Html.ActionLink&amp;lt;HomeController&amp;gt;(c =&amp;gt; c.Index(),&lt;span class="str"&gt;"Home"&lt;/span&gt;)&lt;/pre&gt;
So I no longer see a need for my GenerateUrl method and have removed it from my helper. All of this would be much easier if there was some documentation. Im sure there is a better way so if you can think of an improvement please leave it in the comments.&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122298"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122298" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/liammclennan/aggbug/122298.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Liam McLennan</dc:creator>
            <guid>http://geekswithblogs.net/liammclennan/archive/2008/05/21/122298.aspx</guid>
            <pubDate>Thu, 22 May 2008 01:21:20 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/liammclennan/comments/122298.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/liammclennan/archive/2008/05/21/122298.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/liammclennan/comments/commentRss/122298.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/liammclennan/services/trackbacks/122298.aspx</trackback:ping>
        </item>
        <item>
            <title>Cashbacks are a scam</title>
            <link>http://geekswithblogs.net/liammclennan/archive/2008/05/21/122297.aspx</link>
            <description>Lately I have noticed a trend in electronics retailing. Shops have started selling a large number of items with cashbacks. Here is &lt;a href="http://www.harveynorman.com.au/currentpromotions/"&gt;an example of what I mean&lt;/a&gt;. Cashbacks are provided by the wholesaler to the consumer as a means of passing on discounts in a way that cannot be absorbed by the retailer. For example, if the wholesaler discounts the cost of an item by $250 what is to stop the retailer absorbing the $250 as additional profit? But if the wholesaler offers a $250 cashback then the consumer is theoretically protected from the retailers opportunism. &lt;br /&gt;
&lt;br /&gt;
I strongly dislike cashbacks. They are effectively an interest free, indefinite term, loan from the consumer to the wholesaler. Instead of the vendor asking the consumer for money in exchange for goods the consumer is left asking the vendor for their own money back. Frankly there is very little compelling the vendor to actually pay the cash back. Here is an exerpt I received from Sony after I tried to claim a cashback for my television:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="margin-left: 40px; font-style: italic;"&gt;We've sent you this email to let you know that we have received the information you sent us in order to claim CASHBACK. &lt;br /&gt;
However, the following problem(s) have been identified with the cash back claim(s):&lt;br /&gt;
&lt;br /&gt;
Claim XXXXXX - $150.00 cash back for BRAVIA TV Model:KDL40D3100 - &lt;br /&gt;
We did not receive the section of the product packaging showing the product serial number.&lt;/div&gt;
&lt;br /&gt;
This email was sent without any contact details that might be used to resolve the problem. Of course the problem is that they did receive the serial number in question. I cannot resend the piece of packaging that I have already sent to them. The lack of contact information in their email is what annoys me the most. The message is clearly that they will resist paying as much as they can. &lt;br /&gt;
&lt;br /&gt;
When important things go missing, such as the piece of packaging required to claim a $150 cashback, it makes me wonder if someone has found a way to beat the system.&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122297"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122297" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/liammclennan/aggbug/122297.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Liam McLennan</dc:creator>
            <guid>http://geekswithblogs.net/liammclennan/archive/2008/05/21/122297.aspx</guid>
            <pubDate>Thu, 22 May 2008 00:56:20 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/liammclennan/comments/122297.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/liammclennan/archive/2008/05/21/122297.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/liammclennan/comments/commentRss/122297.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/liammclennan/services/trackbacks/122297.aspx</trackback:ping>
        </item>
        <item>
            <title>Building a Vista Media Center Home Theatre PC</title>
            <link>http://geekswithblogs.net/liammclennan/archive/2008/05/12/122071.aspx</link>
            <description>For a while I have been thinking about building a media center PC but I could not bring myself to purchase a new machine just for home theatre. Then it occurred to me that I already have a server that runs constantly - why not use it for media center as well? &lt;br /&gt;
&lt;br /&gt;
I began with a fresh install of Vista Ultimate since it includes media center. The first problem I encountered was that Vista does not support my old AGP graphics card. When building a home theatre PC (HTPC) two important considerations are noise and power consumption. So when chosing a new video card I wanted a passively cooled solution to minimize power use and noise. &lt;br /&gt;
&lt;img width="300" height="300" border="0" align="left" src="/images/geekswithblogs_net/liammclennan/AGP6200AL-128MTV-unit.jpg" alt="Geforce 6200" /&gt;I settled on a Geforce 6200, because I could get an AGP version and because it was passively cooled. This turned out to be a bad decision as the 6200 is not sufficient for Vista media center. It works but the performance is not what I would like, and it is completely incapable of handling the new HD digital channels.&lt;br /&gt;
&lt;br /&gt;
The server that I converted to a HTPC is based on an AMD Athlon 64 3000 with 2g of RAM. This was also insufficient. The CPU usage varies between 30%-60% resulting in occassional pausing and stuttering that ruins the HTPC experience. I have overclocked the chip 10% (from 1.8Ghz - 2Ghz) but it is too little too late. &lt;br /&gt;
&lt;br /&gt;
For the digital TV tuner I went with the Leadtek Winfast DTV2000H because they are well reviewed, cheap and readily available. Installing the drivers was a pain but other than that I think it is a good card and the compatability with Vista Media Center seems to be excellent. &lt;br /&gt;
&lt;br /&gt;
&lt;img width="200" height="166" border="0" align="left" src="/images/geekswithblogs_net/liammclennan/winfast_dtv2000h_3s.jpg" alt="" /&gt;Overall I am happy with the system. It works, even if it is a little noisy (PSU) and a little underpowered. My favourite feature of HTPC is the easy access to my digital music collection, and that function at least works perfectly.  If I was to do it again I would use a higher spec machine, or the older XP Media Center. Total cost for the upgrade was around $250.00.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122071"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122071" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/liammclennan/aggbug/122071.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Liam McLennan</dc:creator>
            <guid>http://geekswithblogs.net/liammclennan/archive/2008/05/12/122071.aspx</guid>
            <pubDate>Mon, 12 May 2008 08:22:41 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/liammclennan/comments/122071.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/liammclennan/archive/2008/05/12/122071.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/liammclennan/comments/commentRss/122071.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/liammclennan/services/trackbacks/122071.aspx</trackback:ping>
        </item>
    </channel>
</rss>