<?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:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" 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:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>Maarten Balliauw {blog}</title>
    <description>ASP.NET, ASP.NET MVC, Azure, PHP, OpenXML, VSTS, ...</description>
    <link>http://blog.maartenballiauw.be/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 1.5.0.7</generator>
    <language>en-US</language>
    <blogChannel:blogRoll>http://blog.maartenballiauw.be/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.dotnetblogengine.net/syndication.axd</blogChannel:blink>
    <dc:creator>Maarten Balliauw</dc:creator>
    <dc:title>Maarten Balliauw {blog}</dc:title>
    <geo:lat>0.000000</geo:lat>
    <geo:long>0.000000</geo:long>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/maartenballiauw" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <title>Localize ASP.NET MVC 2 DataAnnotations validation messages</title>
      <description>&lt;p&gt;Living in a country where there are there are &lt;a href="http://en.wikipedia.org/wiki/Belgium#Languages" target="_blank"&gt;three languages being used&lt;/a&gt;, almost every application you work on requires some form of localization. In an earlier blog post, I already mentioned &lt;a href="http://blog.maartenballiauw.be/post/2009/07/31/ASPNET-MVC-2-Preview-1-released!.aspx" target="_blank"&gt;ASP.NET MVC 2&amp;rsquo;s DataAnnotations&lt;/a&gt; support for doing model validation. Ever since, I was wondering if it would be possible to use resource files or something to do localization of error messages, since every example that could be found on the Internet looks something like this:&lt;/p&gt;
&lt;p&gt;&lt;div class="code"&gt;

&lt;p&gt;[MetadataType(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(PersonBuddy))] &lt;br /&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Person &lt;br /&gt;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Name { get; set; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Email { get; set; } &lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; PersonBuddy &lt;br /&gt;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Required(ErrorMessage = &lt;span class="str"&gt;"Name is required."&lt;/span&gt;)] &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Name { get; set; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Required(ErrorMessage = &lt;span class="str"&gt;"E-mail is required."&lt;/span&gt;) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Email { get; set; } &lt;br /&gt;}&lt;/p&gt;
&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Yes, those are hardcoded error messages. And yes, only in one language. Let&amp;rsquo;s see how localization of these would work.&lt;/p&gt;
&lt;h2&gt;1. Create a resource file&lt;/h2&gt;
&lt;p&gt;Add a resource file to your ASP.NET MVC 2 application. Not in &lt;em&gt;App_GlobalResources&lt;/em&gt; or &lt;em&gt;App_LocalResources&lt;/em&gt;, just a resource file in a regular namespace. Next, enter all error messages that should be localized in a key/value manner. Before you leave this file, make sure that the &lt;em&gt;Access&lt;/em&gt; &lt;em&gt;Modifier&lt;/em&gt; property is set to &lt;em&gt;Public&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 5px auto; display: block; float: none; border-top: 0px; border-right: 0px" title="Access modifier in resource file" src="http://blog.maartenballiauw.be/image.axd?picture=image_19.png" border="0" alt="Access modifier in resource file" width="404" height="119" /&gt;&lt;/p&gt;
&lt;h2&gt;2. Update your &amp;ldquo;buddy classes&amp;rdquo;&lt;/h2&gt;
&lt;p&gt;Update your &amp;ldquo;buddy classes&amp;rdquo; (or metadata classes or whatever you call them) to use the &lt;em&gt;ErrorMessageResourceType&lt;/em&gt; and &lt;em&gt;ErrorMessageResourceName&lt;/em&gt; parameters instead of the &lt;em&gt;ErrorMessage&lt;/em&gt; parameter that you normally pass. Here&amp;rsquo;s the example from above:&lt;/p&gt;
&lt;p&gt;&lt;div class="code"&gt;

&lt;p&gt;[MetadataType(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(PersonBuddy))] &lt;br /&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Person &lt;br /&gt;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Name { get; set; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Email { get; set; } &lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; PersonBuddy &lt;br /&gt;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Required(ErrorMessageResourceType = &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(Resources.ModelValidation), ErrorMessageResourceName = &lt;span class="str"&gt;"NameRequired"&lt;/span&gt;)] &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Name { get; set; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Required(ErrorMessageResourceType = &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(Resources.ModelValidation), ErrorMessageResourceName = &lt;span class="str"&gt;"EmailRequired"&lt;/span&gt;)] &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Email { get; set; } &lt;br /&gt;}&lt;/p&gt;
&lt;/div&gt;&lt;/p&gt;
&lt;h2&gt;3. See it work!&lt;/h2&gt;
&lt;p&gt;After creating a resource file and updating the buddy classes, you can go back to work and use model binders, &lt;em&gt;ValidationMessage&lt;/em&gt; and &lt;em&gt;ValidationSummary&lt;/em&gt;. ASP.NET will make sure that the correct language is used based on the thread culture info.&lt;/p&gt;
&lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="Localized error messages" src="http://blog.maartenballiauw.be/image.axd?picture=image_20.png" border="0" alt="Localized error messages" width="404" height="423" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http://blog.maartenballiauw.be/post/2009/11/05/Localize-ASPNET-MVC-2-DataAnnotations-validation-messages.aspx&amp;amp;title=Localize ASP.NET MVC 2 DataAnnotations validation messages"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://blog.maartenballiauw.be/post/2009/11/05/Localize-ASPNET-MVC-2-DataAnnotations-validation-messages.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt; &lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/maartenballiauw/~4/cpRKGqJUYTI" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/maartenballiauw/~3/cpRKGqJUYTI/post.aspx</link>
      <author>maartenba</author>
      <comments>http://blog.maartenballiauw.be/post/2009/11/05/Localize-ASPNET-MVC-2-DataAnnotations-validation-messages.aspx#comment</comments>
      <guid isPermaLink="false">http://blog.maartenballiauw.be/post.aspx?id=32e4af67-9ae7-4d5d-99d4-ed0756941d8a</guid>
      <pubDate>Thu, 05 Nov 2009 14:26:00 +0100</pubDate>
      <category>ASP.NET</category>
      <category>C#</category>
      <category>General</category>
      <category>ICT</category>
      <category>Internet</category>
      <category>MVC</category>
      <dc:publisher>maartenba</dc:publisher>
      <pingback:server>http://blog.maartenballiauw.be/pingback.axd</pingback:server>
      <pingback:target>http://blog.maartenballiauw.be/post.aspx?id=32e4af67-9ae7-4d5d-99d4-ed0756941d8a</pingback:target>
      <slash:comments>10</slash:comments>
      <trackback:ping>http://blog.maartenballiauw.be/trackback.axd?id=32e4af67-9ae7-4d5d-99d4-ed0756941d8a</trackback:ping>
      <wfw:comment>http://blog.maartenballiauw.be/post/2009/11/05/Localize-ASPNET-MVC-2-DataAnnotations-validation-messages.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.maartenballiauw.be/syndication.axd?post=32e4af67-9ae7-4d5d-99d4-ed0756941d8a</wfw:commentRss>
    <feedburner:origLink>http://blog.maartenballiauw.be/post.aspx?id=32e4af67-9ae7-4d5d-99d4-ed0756941d8a</feedburner:origLink></item>
    <item>
      <title>Windows Azure Tools for Eclipse for PHP developers</title>
      <description>&lt;p&gt;Pfew! Finally I can spread the word on this! While working on the &lt;a href="http://phpazure.codeplex.com" target="_blank"&gt;Windows Azure SDK for PHP&lt;/a&gt;, I had the opportunity to test-drive the development builds of the WIndows Azure Tools for Eclipse. Today, the project has been released officially at &lt;a href="http://www.windowsazure4e.org"&gt;www.windowsazure4e.org&lt;/a&gt;. Windows Azure Tools for Eclipse provides a series of wizards and utilities that allow developers to write, debug, and configure for and deploy PHP applications to Windows Azure.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.maartenballiauw.be/image.axd?picture=image_18.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 5px auto; display: block; float: none; border-top: 0px; border-right: 0px" title="image" src="http://blog.maartenballiauw.be/image.axd?picture=image_thumb_6.png" border="0" alt="image" width="632" height="382" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The plug-in also bundles the existing &lt;a href="http://blogs.msdn.com/interoperability/archive/2009/07/07/july-ctp-of-php-sdk-for-windows-azure-released-and-support-in-zend-framework.aspx"&gt;Windows Azure SDK for PHP&lt;/a&gt;, which was introduced a few months ago. This SDK provides a simple API for PHP developers who use the Windows Azure storage component, making it very easy to use the blob, queue and table data storage features. Just visit the project site at &lt;a href="http://phpazure.codeplex.com/"&gt;http://phpazure.codeplex.com/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Some labs are available to help you get started with PHP on the WIndows Azure platform: &lt;a title="http://www.windowsazure4e.org/learn/" href="http://www.windowsazure4e.org/learn/"&gt;http://www.windowsazure4e.org/learn/&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/maartenballiauw/~4/moPev_K5v_8" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/maartenballiauw/~3/moPev_K5v_8/post.aspx</link>
      <author>maartenba</author>
      <comments>http://blog.maartenballiauw.be/post/2009/10/28/Windows-Azure-Tools-for-Eclipse-for-PHP-developers.aspx#comment</comments>
      <guid isPermaLink="false">http://blog.maartenballiauw.be/post.aspx?id=4b7d5a5b-a6c1-4ebf-a568-c314cbb1c035</guid>
      <pubDate>Wed, 28 Oct 2009 12:01:00 +0100</pubDate>
      <category>Azure</category>
      <category>C#</category>
      <category>General</category>
      <category>ICT</category>
      <category>Internet</category>
      <category>PHP</category>
      <category>Software</category>
      <dc:publisher>maartenba</dc:publisher>
      <pingback:server>http://blog.maartenballiauw.be/pingback.axd</pingback:server>
      <pingback:target>http://blog.maartenballiauw.be/post.aspx?id=4b7d5a5b-a6c1-4ebf-a568-c314cbb1c035</pingback:target>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://blog.maartenballiauw.be/trackback.axd?id=4b7d5a5b-a6c1-4ebf-a568-c314cbb1c035</trackback:ping>
      <wfw:comment>http://blog.maartenballiauw.be/post/2009/10/28/Windows-Azure-Tools-for-Eclipse-for-PHP-developers.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.maartenballiauw.be/syndication.axd?post=4b7d5a5b-a6c1-4ebf-a568-c314cbb1c035</wfw:commentRss>
    <feedburner:origLink>http://blog.maartenballiauw.be/post.aspx?id=4b7d5a5b-a6c1-4ebf-a568-c314cbb1c035</feedburner:origLink></item>
    <item>
      <title>Upcoming sessions on Azure, PHP and ASP.NET</title>
      <description>&lt;p&gt;It&amp;rsquo;s going to be a filled end of 2009&amp;hellip; There&amp;rsquo;s &lt;a href="http://www.microsoftpdc.com" target="_blank"&gt;Microsoft PDC&lt;/a&gt; which I will be attending and will probably cause me some sleepless nights (both due to jetlag and due to all the new stuff that will be released). Next to that, I&amp;rsquo;ll also be doing some sessions in the next few weeks. Here&amp;rsquo;s a list&amp;hellip;&lt;/p&gt;
&lt;table style="width: 550px; border: #000000 1px solid;" border="1" cellspacing="0" cellpadding="2" align="center"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="background-color: #eeeeee;" valign="top"&gt;
&lt;p&gt;&lt;strong&gt;Date&lt;/strong&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td style="background-color: #eeeeee;" valign="top"&gt;
&lt;p&gt;&lt;strong&gt;Event&lt;/strong&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="130" valign="top"&gt;
&lt;p&gt;&lt;strong&gt;28 october 2009&lt;/strong&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td width="484" valign="top"&gt;
&lt;p&gt;PHPBenelux Meeting: PHP and Microsoft technologies&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ll be doing two sessions here:&lt;/p&gt;
&lt;p&gt;&amp;middot; &lt;strong&gt;PHP and Silverlight&lt;/strong&gt;, together with &lt;a href="http://kevindockx.blogspot.com/"&gt;Kevin Dockx&lt;/a&gt; &lt;br /&gt;&lt;em&gt;&amp;ldquo;This session covers the basics of Microsoft Silverlight and demonstrates how PHP developers can benefit from developing rich client-side components that run in the web browser using Silverlight and PHP.&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;middot; &lt;strong&gt;Make Web not War&lt;/strong&gt;, together with &lt;a href="http://blogs.msdn.com/katriend"&gt;Katrien De Graeve&lt;/a&gt; &lt;br /&gt;&lt;em&gt;&amp;ldquo;Microsoft will present the array of initiatives in the company to better support and integrate with PHP and give you an introduction on Windows Azure and its support for PHP in the cloud.&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;More info? &lt;a href="http://www.phpbenelux.eu"&gt;www.phpbenelux.eu&lt;/a&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="130" valign="top"&gt;
&lt;p&gt;&lt;strong&gt;4 november 2009&lt;/strong&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td width="484" valign="top"&gt;
&lt;p&gt;First Azure User Group Belgium (AZUG.be) meeting&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ll be doing an introductory session to Microsoft&amp;rsquo;s Azure platform. Yves Goeleven and Kurt Claeys will be showing off .NET services and provide more info on the AZUG.be. All of this followed by an open discussion.&lt;/p&gt;
&lt;p&gt;Register now on &lt;a href="http://www.azug.be"&gt;www.azug.be&lt;/a&gt;!&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="130" valign="top"&gt;
&lt;p&gt;&lt;strong&gt;24 november 2009&lt;/strong&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td width="484" valign="top"&gt;
&lt;p&gt;MSDN Live Meeting (Dutch)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Een ASP.NET-applicatie overbrengen naar Windows Azure &lt;br /&gt;&lt;/strong&gt;&lt;em&gt;&amp;ldquo;Zet alles over naar the cloud! Met Windows Azure kunt u voordeel halen uit de cloud computing-infrastructuur voor hosting, computing en storage van uw applicaties. De sessie bevat talrijke demo&amp;rsquo;s, we brengen een bestaande ASP.Net-applicatie over naar hosting in Windows Azure en maken gebruik van Windows Azure storage&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;More info on the &lt;a href="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032424500&amp;amp;EventCategory=2&amp;amp;culture=nl-BE&amp;amp;CountryCode=BE"&gt;MSDN pages&lt;/a&gt;!&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Looking forward to see you at one of these events!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/maartenballiauw/~4/ZpXF4AdJGH0" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/maartenballiauw/~3/ZpXF4AdJGH0/post.aspx</link>
      <author>maartenba</author>
      <comments>http://blog.maartenballiauw.be/post/2009/10/23/Upcoming-sessions-on-Azure-PHP-and-ASPNET.aspx#comment</comments>
      <guid isPermaLink="false">http://blog.maartenballiauw.be/post.aspx?id=814ba030-52f2-45b1-a156-470c47f273c6</guid>
      <pubDate>Fri, 23 Oct 2009 14:48:00 +0100</pubDate>
      <category>ASP.NET</category>
      <category>Azure</category>
      <category>C#</category>
      <category>Events</category>
      <category>General</category>
      <category>ICT</category>
      <category>Internet</category>
      <category>PHP</category>
      <category>Presentations</category>
      <category>Screencasts</category>
      <dc:publisher>maartenba</dc:publisher>
      <pingback:server>http://blog.maartenballiauw.be/pingback.axd</pingback:server>
      <pingback:target>http://blog.maartenballiauw.be/post.aspx?id=814ba030-52f2-45b1-a156-470c47f273c6</pingback:target>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://blog.maartenballiauw.be/trackback.axd?id=814ba030-52f2-45b1-a156-470c47f273c6</trackback:ping>
      <wfw:comment>http://blog.maartenballiauw.be/post/2009/10/23/Upcoming-sessions-on-Azure-PHP-and-ASPNET.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.maartenballiauw.be/syndication.axd?post=814ba030-52f2-45b1-a156-470c47f273c6</wfw:commentRss>
    <feedburner:origLink>http://blog.maartenballiauw.be/post.aspx?id=814ba030-52f2-45b1-a156-470c47f273c6</feedburner:origLink></item>
    <item>
      <title>Recording of my session at Remix 2009 - ASP.NET MVC</title>
      <description>&lt;p&gt;On September 29, I did a session on ASP.NET MVC at Remix 2009 Belgium. All session recordings are now online, check the &lt;a href="http://www.microsoft.com/belux/remix09/#agenda" target="_blank"&gt;Remix09 site&lt;/a&gt;.&amp;nbsp;Slides and code for my talk can be found in a &lt;a href="http://blog.maartenballiauw.be/post/2009/09/29/Remix-2009-session-Slides-and-code.aspx"&gt;previous blog post&lt;/a&gt;. The video material can be found below. Enjoy! And feel free to leave some comments!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http://blog.maartenballiauw.be/post/2009/10/23/Recording-of-my-session-at-Remix-2009-ASPNET-MVC.aspx&amp;amp;title=Recording of my session at Remix 2009 - ASP.NET MVC"&gt;
                    &lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://blog.maartenballiauw.be/post/2009/10/23/Recording-of-my-session-at-Remix-2009-ASPNET-MVC.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;
                  &lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;ASP.NET MVC Wisdom&lt;/h2&gt;
&lt;p&gt;
Abstract: &lt;em&gt;&amp;quot;Building a Twitter clone in 60 minutes, featuring what's new in ASP.NET MVC 2 preview 1 and focusing on some of the core ASP.NET MVC features like security and routing.&amp;quot;&lt;/em&gt; 
&lt;/p&gt;
&lt;p style="text-align: center"&gt;
&lt;iframe src="http://www.microsoft.com/belux/msdn/nl/chopsticks/player.aspx?id=1412&amp;amp;e=1" width="493" height="385" frameborder="0"&gt;&lt;/iframe&gt;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/maartenballiauw/~4/XqlSX1knsWs" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/maartenballiauw/~3/XqlSX1knsWs/post.aspx</link>
      <author>maartenba</author>
      <comments>http://blog.maartenballiauw.be/post/2009/10/23/Recording-of-my-session-at-Remix-2009-ASPNET-MVC.aspx#comment</comments>
      <guid isPermaLink="false">http://blog.maartenballiauw.be/post.aspx?id=ea4eeed1-2cab-41b7-afa2-77ca78ecdf2f</guid>
      <pubDate>Fri, 23 Oct 2009 08:35:00 +0100</pubDate>
      <category>ASP.NET</category>
      <category>C#</category>
      <category>Events</category>
      <category>General</category>
      <category>Internet</category>
      <category>MVC</category>
      <category>Presentations</category>
      <category>Screencasts</category>
      <dc:publisher>maartenba</dc:publisher>
      <pingback:server>http://blog.maartenballiauw.be/pingback.axd</pingback:server>
      <pingback:target>http://blog.maartenballiauw.be/post.aspx?id=ea4eeed1-2cab-41b7-afa2-77ca78ecdf2f</pingback:target>
      <slash:comments>9</slash:comments>
      <trackback:ping>http://blog.maartenballiauw.be/trackback.axd?id=ea4eeed1-2cab-41b7-afa2-77ca78ecdf2f</trackback:ping>
      <wfw:comment>http://blog.maartenballiauw.be/post/2009/10/23/Recording-of-my-session-at-Remix-2009-ASPNET-MVC.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.maartenballiauw.be/syndication.axd?post=ea4eeed1-2cab-41b7-afa2-77ca78ecdf2f</wfw:commentRss>
    <feedburner:origLink>http://blog.maartenballiauw.be/post.aspx?id=ea4eeed1-2cab-41b7-afa2-77ca78ecdf2f</feedburner:origLink></item>
    <item>
      <title>Let me Bing that for you</title>
      <description>&lt;p&gt;Have you ever been bugged with stupid questions? Do you get tired of people asking stuff that is only one search engine query away? Chances are you answered both of these questions with &amp;ldquo;yes!&amp;rdquo;. Together with &lt;a href="http://www.haacked.com"&gt;Phil Haack&lt;/a&gt; and &lt;a href="http://www.hanssens.org"&gt;Juli&amp;euml;n Hanssens&lt;/a&gt;, I created &lt;a href="http://www.letmebingthatforyou.com/"&gt;LetMeBingThatForYou.com&lt;/a&gt;, a website that generates a search engine query for people who ask you questions they could easily answer by themselves.&lt;/p&gt;
&lt;p style="text-align: left;"&gt;&lt;a href="http://tinyurl.com/yfj4f3v" target="_blank"&gt;&lt;/a&gt;Yes, the idea is a copy of &lt;a href="http://www.letmegooglethatforyou.com"&gt;LetMeGoogleThatForYou.com&lt;/a&gt;. However, we thought &lt;a href="http://www.bing.com"&gt;Bing&lt;/a&gt; deserved something similar. We even got Bing&amp;rsquo;s picture of the day working. How cool is that?&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;img style="margin-top: 5px; display: block; margin-bottom: 5px; border: 0px;" title="Find Chuck Norris" src="http://blog.maartenballiauw.be/image.axd?picture=image_17.png" border="0" alt="Find Chuck Norris" width="630" height="484" /&gt;&lt;/p&gt;
&lt;p&gt;One last note: this project is not associated with Microsoft nor Bing. We&amp;rsquo;re doing this project for fun.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http://blog.maartenballiauw.be/post/2009/10/19/Let-me-Bing-that-for-you.aspx&amp;amp;title=Let me Bing that for you"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://blog.maartenballiauw.be/post/2009/10/19/Let-me-Bing-that-for-you.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt; &lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/maartenballiauw/~4/zDHlgRRfzeY" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/maartenballiauw/~3/zDHlgRRfzeY/post.aspx</link>
      <author>maartenba</author>
      <comments>http://blog.maartenballiauw.be/post/2009/10/19/Let-me-Bing-that-for-you.aspx#comment</comments>
      <guid isPermaLink="false">http://blog.maartenballiauw.be/post.aspx?id=177a8387-1cbc-414c-8936-e67db30f4a4a</guid>
      <pubDate>Mon, 19 Oct 2009 10:19:00 +0100</pubDate>
      <category>ASP.NET</category>
      <category>C#</category>
      <category>Fun</category>
      <category>General</category>
      <category>ICT</category>
      <category>Internet</category>
      <category>MVC</category>
      <dc:publisher>maartenba</dc:publisher>
      <pingback:server>http://blog.maartenballiauw.be/pingback.axd</pingback:server>
      <pingback:target>http://blog.maartenballiauw.be/post.aspx?id=177a8387-1cbc-414c-8936-e67db30f4a4a</pingback:target>
      <slash:comments>7</slash:comments>
      <trackback:ping>http://blog.maartenballiauw.be/trackback.axd?id=177a8387-1cbc-414c-8936-e67db30f4a4a</trackback:ping>
      <wfw:comment>http://blog.maartenballiauw.be/post/2009/10/19/Let-me-Bing-that-for-you.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.maartenballiauw.be/syndication.axd?post=177a8387-1cbc-414c-8936-e67db30f4a4a</wfw:commentRss>
    <feedburner:origLink>http://blog.maartenballiauw.be/post.aspx?id=177a8387-1cbc-414c-8936-e67db30f4a4a</feedburner:origLink></item>
    <item>
      <title>Leveraging ASP.NET MVC 2 futures “ViewState”</title>
      <description>&lt;p&gt;Let&amp;rsquo;s start this blog post with a confession: yes, I abused a feature in the ASP.NET MVC 2 futures assembly to fire up discussion. In my &lt;a href="http://blog.maartenballiauw.be/post/2009/10/06/Exploring-the-ASPNET-MVC-2-futures-assemby.aspx#comment" target="_blank"&gt;previous blog post&lt;/a&gt;, I called something &amp;ldquo;ViewState in MVC&amp;rdquo; while it is not really ViewState. To be honest, I did this on purpose, wanting to see people discuss this possibly new feature in MVC 2. Discussion started quite fast: most people do not like the word ViewState, especially when it is linked to ASP.NET MVC. As &lt;a href="http://www.haacked.com" target="_blank"&gt;Phil Haack&lt;/a&gt; pointed out in a &lt;a href="http://blog.maartenballiauw.be/post/2009/10/06/Exploring-the-ASPNET-MVC-2-futures-assemby.aspx#comment" target="_blank"&gt;comment on my previous blog post&lt;/a&gt;, I used this foul word where it was not appropriate.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;(&amp;hellip;) I think calling it ViewState is very misleading. (&amp;hellip;) what your serializing is the state of the Model, not the View. (&amp;hellip;)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That&amp;rsquo;s the truth! But&amp;hellip; how should we call this then? There is already something called &lt;em&gt;ModelState&lt;/em&gt;, and this is something different. Troughout this blog post, I will refer to this as &amp;ldquo;Serialized Model State&amp;rdquo;, or &amp;ldquo;SMS&amp;rdquo; in short. Not an official abbreviation, just something to have a shared meaning with you as a reader.&lt;/p&gt;
&lt;p&gt;So, SMS&amp;hellip; Let&amp;rsquo;s use this in a practical example.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http://blog.maartenballiauw.be/post/2009/10/08/Leveraging-ASPNET-MVC-2-futures-ViewState.aspx&amp;amp;title=Leveraging ASP.NET MVC 2 futures “ViewState”"&gt;
                    &lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://blog.maartenballiauw.be/post/2009/10/08/Leveraging-ASPNET-MVC-2-futures-ViewState.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;
                  &lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Example: Optimistic Concurrency&lt;/h2&gt;
&lt;p&gt;&lt;a href="http://blog.maartenballiauw.be/image.axd?picture=image_16.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; display: inline; border-top: 0px; border-right: 0px" title="Concurrency between old train and updated train." src="http://blog.maartenballiauw.be/image.axd?picture=image_thumb_5.png" border="0" alt="Concurrency between old train and updated train." width="244" height="138" align="left" /&gt;&lt;/a&gt; Every developer who has worked on a business application will definitely have come to deal with optimistic concurrency. Data retrieved from the database has a unique identifier and a timestamp, used for optimistic concurrency control. When editing this data, the identifier and timestamp have to be associated with the client operation, requiring a persistence mechanism. This mechanism should make sure the identifier and timestamp are preserved to verify if another user has updated it since it was originally retrieved.&lt;/p&gt;
&lt;p&gt;There are some options to do this: you can store this in &lt;em&gt;TempData&lt;/em&gt;, in a &lt;em&gt;Cookie&lt;/em&gt; or in &lt;em&gt;Session&lt;/em&gt; state. A more obvious choice, however, would be a mechanism like &amp;ldquo;SMS&amp;rdquo;: it allows you to persist the model state on your view, allowing to retrieve the state of your model whenever data is posted to an action method. The fact that it is on your view, means that is linked to a specific request that will happen in the future.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s work with a simple &lt;em&gt;Person&lt;/em&gt; class, consisting of &lt;em&gt;Id&lt;/em&gt;, &lt;em&gt;Name&lt;/em&gt;, &lt;em&gt;Email&lt;/em&gt; and &lt;em&gt;RowState&lt;/em&gt; properties. &lt;em&gt;RowState&lt;/em&gt; will contain a &lt;em&gt;DateTime&lt;/em&gt; value when the database record was last updated. An action method fetching data is created:&lt;/p&gt;
&lt;p&gt;&lt;div class="code"&gt;

&lt;p&gt;[HttpGet] &lt;br /&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult Edit(&lt;span class="kwrd"&gt;int&lt;/span&gt; id) &lt;br /&gt;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;// Simulate fetching Person from database &lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Person initialPersonFromDatabase = &lt;span class="kwrd"&gt;new&lt;/span&gt; Person &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Id = id, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FirstName = &lt;span class="str"&gt;"Maarten"&lt;/span&gt;, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LastName = &lt;span class="str"&gt;"Balliauw"&lt;/span&gt;, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Email = &lt;span class="str"&gt;""&lt;/span&gt;, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RowVersion = DateTime.Now &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;return&lt;/span&gt; View(initialPersonFromDatabase); &lt;br /&gt;}&lt;/p&gt;
&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;The view renders an edit form for our person:&lt;/p&gt;
&lt;p&gt;&lt;div class="code"&gt;

&lt;p&gt;&amp;lt;h2&amp;gt;Concurrency demo&amp;lt;/h2&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;% Html.EnableClientValidation(); %&amp;gt; &lt;br /&gt;&amp;lt;%= Html.ValidationSummary(&lt;span class="str"&gt;"Edit was unsuccessful. Please correct the errors and try again."&lt;/span&gt;) %&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;% &lt;span class="kwrd"&gt;using&lt;/span&gt; (Html.BeginForm()) {%&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%=Html.Serialize(&lt;span class="str"&gt;"person"&lt;/span&gt;, Model)%&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;fieldset&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;legend&amp;gt;Edit person&amp;lt;/legend&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%=Html.EditorForModel()%&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type=&lt;span class="str"&gt;"submit"&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;=&lt;span class="str"&gt;"Save"&lt;/span&gt; /&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/p&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/fieldset&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;% } %&amp;gt;&lt;/p&gt;
&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s have a look at this view markup. &lt;em&gt;&amp;lt;%=Html.EditorForModel()%&amp;gt;&lt;/em&gt; renders an editor for our model class &lt;em&gt;Person&lt;/em&gt;. based on templates. This is a new feature in ASP.NET MVC 2.&lt;/p&gt;
&lt;p&gt;Another thing we do in our view is &lt;em&gt;&amp;lt;%=Html.Serialize("person", Model)%&amp;gt;&lt;/em&gt;: this is a &lt;em&gt;HtmlHelper&lt;/em&gt; extension persisting our model to a hidden form field:&lt;/p&gt;
&lt;p&gt;&lt;div class="code"&gt;

&lt;p&gt;&amp;lt;input name=&lt;span class="str"&gt;"person"&lt;/span&gt; type=&lt;span class="str"&gt;"hidden"&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;=&lt;span class="str"&gt;"/wEymwIAAQAAAP&lt;br /&gt;
////8BAAAAAAAAAAwCAAAARE12YzJWaWV3U3RhdGUsIFZlcnNpb249MS4wL&lt;br /&gt;
jAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsBQEA&lt;br /&gt;
AAAbTXZjMlZpZXdTdGF0ZS5Nb2RlbHMuUGVyc29uBAAAABo8Rmlyc3ROYW1&lt;br /&gt;
lPmtfX0JhY2tpbmdGaWVsZBk8TGFzdE5hbWU+a19fQmFja2luZ0ZpZWxkFj&lt;br /&gt;
xFbWFpbD5rX19CYWNraW5nRmllbGQbPFJvd1ZlcnNpb24+a19fQmFja2luZ&lt;br /&gt;
0ZpZWxkAQEBAA0CAAAABgMAAAAHTWFhcnRlbgYEAAAACEJhbGxpYXV3BgUA&lt;br /&gt;
AAAAqCw1nBkWzIgL"&lt;/span&gt; /&amp;gt;&lt;/p&gt;
&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Yes, this looks ugly and smells like ViewState, but it&amp;rsquo;s not. Let&amp;rsquo;s submit our form to the next action method:&lt;/p&gt;
&lt;p&gt;&lt;div class="code"&gt;

&lt;p&gt;[HttpPost] &lt;br /&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult Edit([Deserialize]Person person, FormCollection form) &lt;br /&gt;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;// Update model &lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;if&lt;/span&gt; (!TryUpdateModel(person, form.ToValueProvider())) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;return&lt;/span&gt; View(person);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;// Simulate fetching person from database &lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Person currentPersonFromDatabase = &lt;span class="kwrd"&gt;new&lt;/span&gt; Person &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Id = person.Id, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FirstName = &lt;span class="str"&gt;"Maarten"&lt;/span&gt;, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LastName = &lt;span class="str"&gt;"Balliauw"&lt;/span&gt;, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Email = &lt;span class="str"&gt;"maarten@maartenballiauw.be"&lt;/span&gt;, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RowVersion = DateTime.Now &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;// Compare version with version from model state &lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;if&lt;/span&gt; (currentPersonFromDatabase.RowVersion &amp;gt; person.RowVersion) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;// Concurrency issues! &lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ModelState.AddModelError(&lt;span class="str"&gt;"Person"&lt;/span&gt;, &lt;span class="str"&gt;"Concurrency error: person was changed in database."&lt;/span&gt;);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;return&lt;/span&gt; View(person); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;else&lt;/span&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;// Validation also succeeded &lt;br /&gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;return&lt;/span&gt; RedirectToAction(&lt;span class="str"&gt;"Success"&lt;/span&gt;); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;}&lt;/p&gt;
&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s see what happens here&amp;hellip;The previous model state is deserialized from the hidden field we created in our view, and passed into the parameter &lt;em&gt;person&lt;/em&gt; of this action method. Edited form values are in the &lt;em&gt;FormCollection&lt;/em&gt; parameter. In the action method body, the deserialized model is updated first with the values from the &lt;em&gt;FormCollection&lt;/em&gt; parameter. Next, the current database row is retrieved, having a newer &lt;em&gt;RowVersion&lt;/em&gt; timestamp. This indicates that the record has been modified in the database and that we have a concurrency issue, rendering a validation message.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;&amp;ldquo;ViewState&amp;rdquo; (or &amp;ldquo;SMS&amp;rdquo; or whatever it will be called) is really a useful addition to ASP.NET MVC 2, and I hope this blog post showed you one example usage scenario where it is handy. Next to that, you are not required to use this concept: it&amp;rsquo;s completely optional. So if you still do not like it, then do not use it. Go with &lt;em&gt;Session&lt;/em&gt; state, &lt;em&gt;Cookies&lt;/em&gt;, hidden fields, &amp;hellip;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http://blog.maartenballiauw.be/post/2009/10/08/Leveraging-ASPNET-MVC-2-futures-ViewState.aspx&amp;amp;title=Leveraging ASP.NET MVC 2 futures “ViewState”"&gt;
                    &lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://blog.maartenballiauw.be/post/2009/10/08/Leveraging-ASPNET-MVC-2-futures-ViewState.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;
                  &lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/maartenballiauw/~4/O_jZ5FTdMss" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/maartenballiauw/~3/O_jZ5FTdMss/post.aspx</link>
      <author>maartenba</author>
      <comments>http://blog.maartenballiauw.be/post/2009/10/08/Leveraging-ASPNET-MVC-2-futures-ViewState.aspx#comment</comments>
      <guid isPermaLink="false">http://blog.maartenballiauw.be/post.aspx?id=b60e461a-db3a-4646-98eb-9d3c32fcc493</guid>
      <pubDate>Thu, 08 Oct 2009 11:21:00 +0100</pubDate>
      <category>ASP.NET</category>
      <category>C#</category>
      <category>General</category>
      <category>ICT</category>
      <category>Internet</category>
      <category>MVC</category>
      <dc:publisher>maartenba</dc:publisher>
      <pingback:server>http://blog.maartenballiauw.be/pingback.axd</pingback:server>
      <pingback:target>http://blog.maartenballiauw.be/post.aspx?id=b60e461a-db3a-4646-98eb-9d3c32fcc493</pingback:target>
      <slash:comments>16</slash:comments>
      <trackback:ping>http://blog.maartenballiauw.be/trackback.axd?id=b60e461a-db3a-4646-98eb-9d3c32fcc493</trackback:ping>
      <wfw:comment>http://blog.maartenballiauw.be/post/2009/10/08/Leveraging-ASPNET-MVC-2-futures-ViewState.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.maartenballiauw.be/syndication.axd?post=b60e461a-db3a-4646-98eb-9d3c32fcc493</wfw:commentRss>
    <feedburner:origLink>http://blog.maartenballiauw.be/post.aspx?id=b60e461a-db3a-4646-98eb-9d3c32fcc493</feedburner:origLink></item>
    <item>
      <title>Exploring the ASP.NET MVC 2 futures assemby</title>
      <description>&lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 5px 0px 5px 5px; display: inline; border-top: 0px; border-right: 0px" title="The future is cloudy!" src="http://blog.maartenballiauw.be/image.axd?picture=image_14.png" border="0" alt="The future is cloudy!" width="240" height="213" align="right" /&gt; The latest preview of &lt;a href="http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33836" target="_blank"&gt;ASP.NET MVC 2, preview 2&lt;/a&gt;, has been released on CodePlex last week. All &lt;a href="http://blog.maartenballiauw.be/post/2009/07/31/ASPNET-MVC-2-Preview-1-released!.aspx" target="_blank"&gt;features of the preview 1 version&lt;/a&gt; are still in, as well as some nice novelties like client-side validation, single project areas, the model metadata model, &amp;hellip; You can read more about these &lt;a href="http://suhair.in/Blog/aspnet-areas-in-depth" target="_blank"&gt;here&lt;/a&gt;, &lt;a href="ttp://codingndesign.com/blog/?p=76" target="_blank"&gt;here&lt;/a&gt; and &lt;a href="http://codingndesign.com/blog/?p=96" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Sure, the official preview contains some great features of which I&amp;rsquo;m already a fan: the model and validation metadata model is quite extensible, allowing the use of DataAnnotations, EntLib, NHibernate or your own custom validation logic in your application, while still being able to use standard model binders and client-side validation. Next to all this, a new version of the MVC 2 futures assembly was &lt;a href="http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33836" target="_blank"&gt;released on CodePlex&lt;/a&gt;. And oh boy, there&amp;rsquo;s some interesting stuff in there as well! Let&amp;rsquo;s dive in&amp;hellip;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Quick note: the &amp;ldquo;piece de resistance&amp;rdquo; is near the end of this post. Also make sure to post your thoughts on this &amp;ldquo;piece&amp;rdquo;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http://blog.maartenballiauw.be/post/2009/10/06/Exploring-the-ASPNET-MVC-2-futures-assemby.aspx&amp;amp;title=Exploring the ASP.NET MVC 2 futures assemby"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://blog.maartenballiauw.be/post/2009/10/06/Exploring-the-ASPNET-MVC-2-futures-assemby.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt; &lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Controls&lt;/h2&gt;
&lt;p&gt;There&amp;rsquo;s not much that has changed here since my previous &lt;a href="http://blog.maartenballiauw.be/post/2009/04/02/Back-to-the-future!-Exploring-ASPNET-MVC-Futures.aspx" target="_blank"&gt;blog post on the MVC futures&lt;/a&gt;. Want to use a lightweight TextBox or Repeater control? Feel free to do so:&lt;/p&gt;
&lt;p&gt;&lt;div class="code"&gt;

&lt;p&gt;&amp;lt;p&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TextBox: &amp;lt;mvc:TextBox Name=&lt;span class="str"&gt;"someTextBox"&lt;/span&gt; runat=&lt;span class="str"&gt;"server"&lt;/span&gt; /&amp;gt;&amp;lt;br /&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Password: &amp;lt;mvc:Password Name=&lt;span class="str"&gt;"somePassword"&lt;/span&gt; runat=&lt;span class="str"&gt;"server"&lt;/span&gt; /&amp;gt; &lt;br /&gt;&amp;lt;/p&amp;gt; &lt;br /&gt;&amp;lt;p&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Repeater: &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ul&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;mvc:Repeater Name=&lt;span class="str"&gt;"someData"&lt;/span&gt; runat=&lt;span class="str"&gt;"server"&lt;/span&gt;&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;EmptyDataTemplate&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;No data &lt;span class="kwrd"&gt;is&lt;/span&gt; available.&amp;lt;/li&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/EmptyDataTemplate&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ItemTemplate&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;%# Eval(&lt;span class="str"&gt;"Name"&lt;/span&gt;) %&amp;gt;&amp;lt;/li&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ItemTemplate&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/mvc:Repeater&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ul&amp;gt; &lt;br /&gt;&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;/div&gt;&lt;/p&gt;
&lt;h2&gt;Asynchronous controllers&lt;/h2&gt;
&lt;p&gt;Yes, I also &lt;a href="http://blog.maartenballiauw.be/post/2009/04/08/Using-the-ASPNET-MVC-Futures-AsyncController.aspx" target="_blank"&gt;blogged about these before&lt;/a&gt;. Basically, asynchronous controllers allow you to overcome the fact that processing-intensive action methods may consume all of your web server&amp;rsquo;s worker threads, making your webserver a slow piece of software while it is on top-notch hardware.&lt;/p&gt;
&lt;p&gt;When using asynchronous controllers, the web server schedules a worker thread to handle an incoming request. This worker thread will start a new thread and call the action method on there. The worker thread is now immediately available to handle a new incoming request again.&lt;/p&gt;
&lt;h2&gt;Get some REST!&lt;/h2&gt;
&lt;p&gt;Again: I already blogged on this one: &lt;a href="http://blog.maartenballiauw.be/post/2009/08/19/REST-for-ASPNET-MVC-SDK.aspx" target="_blank"&gt;REST for ASP.NET MVC SDK&lt;/a&gt;. This SDK now seems to become a part of the ASP.NET MVC core, which I really think is great! The REST for ASP.NET MVC SDK adds &amp;ldquo;discovery&amp;rdquo; functionality to your ASP.NET MVC application, returning the client the correct data format he requested. From the official documentation:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;It includes support for machine-readable formats (XML, JSON) and support for content negotiation, making it easy to add POX APIs to existing MVC controllers with minimal changes. &lt;/li&gt;
&lt;li&gt;It includes support for dispatching requests based on the HTTP verb, enabling &amp;ldquo;resource&amp;rdquo; controllers that implement the uniform HTTP interface to perform CRUD (Create, Read, Update and Delete) operations on the model. &lt;/li&gt;
&lt;li&gt;Provides T4 controller and view templates that make implementing the above scenarios easier.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Let&amp;rsquo;s come down to business: the REST SDK is handy because you do not have to care about returning a specific ActionResult: the SDK will automatically check whether a ViewResult, JsonResult, XML output or even an Atom feed is requested by the client. ViewData will automatically be returned in the requested format. Result: cleaner code, less mistakes. As long as you follow conventions of course.&lt;/p&gt;
&lt;h2&gt;Other stuff&amp;hellip;&lt;/h2&gt;
&lt;p&gt;Yeah, I&amp;rsquo;m lazy. I also blogged on this one before. Check my previous &lt;a href="http://blog.maartenballiauw.be/post/2009/04/02/Back-to-the-future!-Exploring-ASPNET-MVC-Futures.aspx" target="_blank"&gt;blog post on the MVC futures&lt;/a&gt; for nice stuff like more action method selectors (like &lt;em&gt;[AcceptAjax]&lt;/em&gt; and others), more &lt;em&gt;HtmlHelper&lt;/em&gt; extensions for images, mailto links, buttons, CSS, &amp;hellip; There&amp;rsquo;s more action filters as well, like &lt;em&gt;[ContentType]&lt;/em&gt; which specifies the content-type headers being sent out with an action method.&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s also donut caching, allowing you to cache all output for an action method except a specific part of the output. This allows you to combine cached views with dynamic content in quite an easy manner.&lt;/p&gt;
&lt;p&gt;More new stuff: the &lt;em&gt;CookieTempDataProvider&lt;/em&gt;, allowing you to turn of session state when using &lt;em&gt;TempData&lt;/em&gt;. There&amp;rsquo;s also the &lt;em&gt;[SkipBinding]&lt;/em&gt; attribute, which tells the ModelBinder infrasructure to bind all action method parameters except the ones decorated with this attribute.&lt;/p&gt;
&lt;h2&gt;ViewState!&lt;/h2&gt;
&lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 0px; display: inline; border-top: 0px; border-right: 0px" title="ViewState gone evil!" src="http://blog.maartenballiauw.be/image.axd?picture=image_15.png" border="0" alt="ViewState gone evil!" width="145" height="99" align="left" /&gt; Got you there, right? The ASP.NET MVC team has been screaming in every presentation they gave in the past year that there was no such thing as ViewState in ASP.NE MVC. Well, there is now&amp;hellip; And maybe, i will be part of the future MVC 2 release as well. Let&amp;rsquo;s first have a look at it and afterwards discuss this all&amp;hellip;&lt;/p&gt;
&lt;p&gt;On every view, a new &lt;em&gt;HtmlHelper&lt;/em&gt; extension method named &amp;ldquo;Serialize&amp;rdquo; is present. This one can be used to create a hidden field inside a HTML form, containing a serialized version of an object. The extension method also allows you to pass a parameter specifying how the object should be serialized. The default option, &lt;em&gt;SerializationMode.PlainText&lt;/em&gt;, simply serializes the object to a string and puts it inside of a hidden field. When using &lt;em&gt;SerializationMode.Encrypted &lt;/em&gt;and/or &lt;em&gt;SerializationMode.Signed&lt;/em&gt;, you are really using ASP.NET Webforms ViewState under the covers.&lt;/p&gt;
&lt;p&gt;The call in your view source code is easy:&lt;/p&gt;
&lt;p&gt;&lt;div class="code"&gt;

&lt;p&gt;&amp;lt;% &lt;span class="kwrd"&gt;using&lt;/span&gt; (Html.BeginForm()) {%&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%Html.Serialize(&lt;span class="str"&gt;"person"&lt;/span&gt;, Model); %&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;fieldset&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;legend&amp;gt;Edit person&amp;lt;/legend&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%=Html.DisplayFor(p =&amp;gt; Model.FirstName)%&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/p&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%=Html.DisplayFor(p =&amp;gt; Model.LastName)%&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/p&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;label &lt;span class="kwrd"&gt;for&lt;/span&gt;=&lt;span class="str"&gt;"Email"&lt;/span&gt;&amp;gt;Email:&amp;lt;/label&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%= Html.TextBox(&lt;span class="str"&gt;"Email"&lt;/span&gt;, Model.Email) %&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%= Html.ValidationMessage(&lt;span class="str"&gt;"Email"&lt;/span&gt;, &lt;span class="str"&gt;"*"&lt;/span&gt;) %&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/p&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type=&lt;span class="str"&gt;"submit"&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;=&lt;span class="str"&gt;"Save"&lt;/span&gt; /&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/p&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/fieldset&amp;gt; &lt;br /&gt;&amp;lt;% } %&amp;gt;&lt;/p&gt;
&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;When posting this form back to a controller action, a new &lt;em&gt;ModelBinder&lt;/em&gt; can be used: The &lt;em&gt;DeserializeAttribute&lt;/em&gt; can be placed next to an action method parameter:&lt;/p&gt;
&lt;p&gt;&lt;div class="code"&gt;

&lt;p&gt;[HttpPost] &lt;br /&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult Edit([Deserialize]Person person, &lt;span class="kwrd"&gt;string&lt;/span&gt; Email) &lt;br /&gt;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="rem"&gt;// ... &lt;br /&gt;}&lt;/p&gt;&lt;/span&gt;
&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;There you go: &lt;em&gt;Person&lt;/em&gt; is the same object as the one you serialized in your view. Combine this with the &lt;em&gt;RenderAction&lt;/em&gt; feature (yes, check my previous &lt;a href="http://blog.maartenballiauw.be/post/2009/04/02/Back-to-the-future!-Exploring-ASPNET-MVC-Futures.aspx" target="_blank"&gt;blog post on the MVC futures&lt;/a&gt;), and you have a powerful model for creating something like controls, which still follows the model-view-controller pattern mostly.&lt;/p&gt;
&lt;p&gt;Now release the hounds: I think this new &amp;ldquo;ViewState&amp;rdquo; feature is cool. There are definitely situations where you may want to use this, but&amp;hellip; Will it be a best practice to use this? What is your opinion on this?&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http://blog.maartenballiauw.be/post/2009/10/06/Exploring-the-ASPNET-MVC-2-futures-assemby.aspx&amp;amp;title=Exploring the ASP.NET MVC 2 futures assemby"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://blog.maartenballiauw.be/post/2009/10/06/Exploring-the-ASPNET-MVC-2-futures-assemby.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt; &lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/maartenballiauw/~4/jsfqeD7VVK4" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/maartenballiauw/~3/jsfqeD7VVK4/post.aspx</link>
      <author>maartenba</author>
      <comments>http://blog.maartenballiauw.be/post/2009/10/06/Exploring-the-ASPNET-MVC-2-futures-assemby.aspx#comment</comments>
      <guid isPermaLink="false">http://blog.maartenballiauw.be/post.aspx?id=aaeaa042-defe-4e8a-8511-1c080f811ddc</guid>
      <pubDate>Tue, 06 Oct 2009 10:25:00 +0100</pubDate>
      <category>ASP.NET</category>
      <category>C#</category>
      <category>General</category>
      <category>ICT</category>
      <category>Internet</category>
      <category>MVC</category>
      <dc:publisher>maartenba</dc:publisher>
      <pingback:server>http://blog.maartenballiauw.be/pingback.axd</pingback:server>
      <pingback:target>http://blog.maartenballiauw.be/post.aspx?id=aaeaa042-defe-4e8a-8511-1c080f811ddc</pingback:target>
      <slash:comments>20</slash:comments>
      <trackback:ping>http://blog.maartenballiauw.be/trackback.axd?id=aaeaa042-defe-4e8a-8511-1c080f811ddc</trackback:ping>
      <wfw:comment>http://blog.maartenballiauw.be/post/2009/10/06/Exploring-the-ASPNET-MVC-2-futures-assemby.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.maartenballiauw.be/syndication.axd?post=aaeaa042-defe-4e8a-8511-1c080f811ddc</wfw:commentRss>
    <feedburner:origLink>http://blog.maartenballiauw.be/post.aspx?id=aaeaa042-defe-4e8a-8511-1c080f811ddc</feedburner:origLink></item>
    <item>
      <title>Remix 2009 session - Slides and code</title>
      <description>&lt;p&gt;&lt;a href="http://blog.maartenballiauw.be/image.axd?picture=2009%2f9%2fmaartenatremix.jpg"&gt;&lt;img src="http://blog.maartenballiauw.be/image.axd?picture=2009%2f9%2fmaartenatremix.jpg" alt="" align="right" width="140" border="0" hspace="5" /&gt;&lt;/a&gt;As promised during the session at Remix 2009, here’s my example code and slide deck.&lt;/p&gt;  &lt;p&gt;Abstract: &lt;em&gt;&amp;quot;Building a Twitter clone in 60 minutes, featuring what's new in ASP.NET MVC 2 preview 1 and focusing on some of the core ASP.NET MVC features like security and routing.&amp;quot;&lt;/em&gt;&lt;/p&gt;

&lt;div style="width:100%;text-align:center;" id="__ss_2091268"&gt;&lt;a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/maartenba/aspnet-mvc-wisdom" title="ASP.NET MVC Wisdom"&gt;ASP.NET MVC Wisdom&lt;/a&gt;&lt;object style="margin:0px" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=asp-netmvcwisdom-090929123237-phpapp01&amp;stripped_title=aspnet-mvc-wisdom" /&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=asp-netmvcwisdom-090929123237-phpapp01&amp;stripped_title=aspnet-mvc-wisdom" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;

&lt;p&gt;Example code can be downloaded here: &lt;a href="http://blog.maartenballiauw.be/file.axd?file=2009%2f9%2fASP.NET+MVC+Wisdom+-+ReMix.zip"&gt;ASP.NET MVC Wisdom - ReMix.zip (8.91 mb)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you for attending!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/maartenballiauw/~4/gZ9oZFd7ISY" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/maartenballiauw/~3/gZ9oZFd7ISY/post.aspx</link>
      <author>maartenba</author>
      <comments>http://blog.maartenballiauw.be/post/2009/09/29/Remix-2009-session-Slides-and-code.aspx#comment</comments>
      <guid isPermaLink="false">http://blog.maartenballiauw.be/post.aspx?id=01e1e6a3-c1d8-42d0-bb1c-6e9f120f578a</guid>
      <pubDate>Tue, 29 Sep 2009 19:38:00 +0100</pubDate>
      <category>ASP.NET</category>
      <category>C#</category>
      <category>Events</category>
      <category>Fun</category>
      <category>General</category>
      <category>ICT</category>
      <category>Internet</category>
      <category>MVC</category>
      <category>Presentations</category>
      <category>Testing</category>
      <dc:publisher>maartenba</dc:publisher>
      <pingback:server>http://blog.maartenballiauw.be/pingback.axd</pingback:server>
      <pingback:target>http://blog.maartenballiauw.be/post.aspx?id=01e1e6a3-c1d8-42d0-bb1c-6e9f120f578a</pingback:target>
      <slash:comments>6</slash:comments>
      <trackback:ping>http://blog.maartenballiauw.be/trackback.axd?id=01e1e6a3-c1d8-42d0-bb1c-6e9f120f578a</trackback:ping>
      <wfw:comment>http://blog.maartenballiauw.be/post/2009/09/29/Remix-2009-session-Slides-and-code.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.maartenballiauw.be/syndication.axd?post=01e1e6a3-c1d8-42d0-bb1c-6e9f120f578a</wfw:commentRss>
    <feedburner:origLink>http://blog.maartenballiauw.be/post.aspx?id=01e1e6a3-c1d8-42d0-bb1c-6e9f120f578a</feedburner:origLink></item>
    <item>
      <title>Simple API for Cloud Application Services</title>
      <description>&lt;p&gt;Zend, in co-operation with IBM, Microsoft, Rackspace, GoGrid and other cloud leaders, today have released their Simple API for Cloud Application Services project. The Simple Cloud API project empowers developers to use one interface to interact with the cloud services offered by different vendors. These vendors are all contributing to this open source project, making sure the Simple Cloud API &amp;ldquo;fits like a glove&amp;rdquo; on top of their service.&lt;/p&gt;
&lt;p&gt;Zend Cloud adapters will be available for services such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;File storage services, including Windows Azure blobs, Rackspace Cloud Files, Nirvanix Storage Delivery Network and Amazon S3 &lt;/li&gt;
&lt;li&gt;Document Storage services, including Windows Azure tables and Amazon SimpleDB &lt;/li&gt;
&lt;li&gt;Simple queue services, including Amazon SQS and Windows Azure queues &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note that the Simple Cloud API is focused on providing a simple and re-usable interface across different cloud services. This implicates that specific features a service offers will not be available using the Simple Cloud API.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s a quick code sample for the Simple Cloud API. Let&amp;rsquo;s upload some data and list the items in a Windows Azure Blob Storage container using the Simple Cloud API:&lt;/p&gt;
&lt;p&gt;&lt;div class="code"&gt;

&lt;p&gt;require_once(&lt;span class="str"&gt;'Zend/Cloud/Storage/WindowsAzure.php'&lt;/span&gt;);&lt;/p&gt;
&lt;p&gt;&lt;span class="rem"&gt;// Create an instance&lt;/span&gt;
&lt;br /&gt;$storage = &lt;span class="kwrd"&gt;new&lt;/span&gt; Zend_Cloud_Storage_WindowsAzure( &lt;br /&gt;&lt;span class="str"&gt;'zendtest'&lt;/span&gt;, &lt;br /&gt;array( &lt;br /&gt;&amp;nbsp; &lt;span class="str"&gt;'host'&lt;/span&gt; =&amp;gt; &lt;span class="str"&gt;'blob.core.windows.net'&lt;/span&gt;, &lt;br /&gt;&amp;nbsp; &lt;span class="str"&gt;'accountname'&lt;/span&gt; =&amp;gt; &lt;span class="str"&gt;'xxxxxx'&lt;/span&gt;, &lt;br /&gt;&amp;nbsp; &lt;span class="str"&gt;'accountkey'&lt;/span&gt; =&amp;gt; &lt;span class="str"&gt;'yyyyyy'&lt;/span&gt; &lt;br /&gt;)); &lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;// Create some data and upload it&lt;/span&gt;
&lt;br /&gt;$item1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; Zend_Cloud_Storage_Item(&lt;span class="str"&gt;'Hello World!'&lt;/span&gt;, array(&lt;span class="str"&gt;'creator'&lt;/span&gt; =&amp;gt; &lt;span class="str"&gt;'Maarten'&lt;/span&gt;)); &lt;br /&gt;$storage-&amp;gt;storeItem($item1, &lt;span class="str"&gt;'data/item.txt'&lt;/span&gt;);&lt;/p&gt;
&lt;p&gt;&lt;span class="rem"&gt;// Now download it!&lt;/span&gt;
&lt;br /&gt;$item2 = $storage-&amp;gt;fetchItem(&lt;span class="str"&gt;'data/item.txt'&lt;/span&gt;, array(&lt;span class="str"&gt;'returntype'&lt;/span&gt; =&amp;gt; 2)); &lt;br /&gt;var_dump($item2);&lt;/p&gt;
&lt;p&gt;&lt;span class="rem"&gt;// List items&lt;/span&gt;
&lt;br /&gt;var_dump( &lt;br /&gt;$storage-&amp;gt;listItems() &lt;br /&gt;);&lt;/p&gt;
&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s quite fun to be a part of this kind of things: I started working for Microsoft on the &lt;a href="http://phpazure.codeplex.com/"&gt;Windows Azure SDK for PHP&lt;/a&gt;, we contributed the same codebase to Zend Framework, and now I&amp;rsquo;m building the Windows Azure implementations for the Simple Cloud API.&lt;/p&gt;
&lt;p&gt;The full press release can be found at the &lt;a href="http://www.simplecloudapi.org"&gt;Simple Cloud API&lt;/a&gt; website.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/maartenballiauw/~4/IDZCbBVrnsc" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/maartenballiauw/~3/IDZCbBVrnsc/post.aspx</link>
      <author>maartenba</author>
      <comments>http://blog.maartenballiauw.be/post/2009/09/22/Simple-API-for-Cloud-Application-Services.aspx#comment</comments>
      <guid isPermaLink="false">http://blog.maartenballiauw.be/post.aspx?id=0f6a225e-ee30-4100-9054-4b08ecaa3925</guid>
      <pubDate>Tue, 22 Sep 2009 13:10:00 +0100</pubDate>
      <category>Azure</category>
      <category>General</category>
      <category>ICT</category>
      <category>Internet</category>
      <category>Projects</category>
      <category>Software</category>
      <category>Zend Framework</category>
      <dc:publisher>maartenba</dc:publisher>
      <pingback:server>http://blog.maartenballiauw.be/pingback.axd</pingback:server>
      <pingback:target>http://blog.maartenballiauw.be/post.aspx?id=0f6a225e-ee30-4100-9054-4b08ecaa3925</pingback:target>
      <slash:comments>8</slash:comments>
      <trackback:ping>http://blog.maartenballiauw.be/trackback.axd?id=0f6a225e-ee30-4100-9054-4b08ecaa3925</trackback:ping>
      <wfw:comment>http://blog.maartenballiauw.be/post/2009/09/22/Simple-API-for-Cloud-Application-Services.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.maartenballiauw.be/syndication.axd?post=0f6a225e-ee30-4100-9054-4b08ecaa3925</wfw:commentRss>
    <feedburner:origLink>http://blog.maartenballiauw.be/post.aspx?id=0f6a225e-ee30-4100-9054-4b08ecaa3925</feedburner:origLink></item>
    <item>
      <title>Joined The Lounge network</title>
      <description>&lt;p&gt;&lt;a href="http://www.theloungenet.com" target="_blank"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 5px; display: inline; border-top: 0px; border-right: 0px" title="logo" src="http://blog.maartenballiauw.be/image.axd?picture=logo_1.jpg" border="0" alt="logo" width="240" height="84" align="right" /&gt;&lt;/a&gt; Last week, I received my invitation to the &lt;a href="http://www.theloungenet.com"&gt;Lounge&lt;/a&gt; network, an exclusive advertising network for &amp;ldquo;trusted and respected publishers focused on Microsoft technologies&amp;rdquo;. First of all, it&amp;rsquo;s cool to see that at least someone considers me as trusted and respected. Next, it&amp;rsquo;s probably a better advertising solution than the &lt;a href="http://www.amazon.com"&gt;Amazon&lt;/a&gt; ads I had earlier. The Lounge will always display ads related to .NET technology, whereas Amazon had its days of displaying lamps and home furniture enhancements.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s see how this works out.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/maartenballiauw/~4/o3MTobf-kGw" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/maartenballiauw/~3/o3MTobf-kGw/post.aspx</link>
      <author>maartenba</author>
      <comments>http://blog.maartenballiauw.be/post/2009/09/10/Joined-The-Lounge-network.aspx#comment</comments>
      <guid isPermaLink="false">http://blog.maartenballiauw.be/post.aspx?id=d64fb6bb-778e-42eb-9fb6-cf4b032a5566</guid>
      <pubDate>Thu, 10 Sep 2009 17:01:00 +0100</pubDate>
      <category>General</category>
      <category>ICT</category>
      <category>Internet</category>
      <dc:publisher>maartenba</dc:publisher>
      <pingback:server>http://blog.maartenballiauw.be/pingback.axd</pingback:server>
      <pingback:target>http://blog.maartenballiauw.be/post.aspx?id=d64fb6bb-778e-42eb-9fb6-cf4b032a5566</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://blog.maartenballiauw.be/trackback.axd?id=d64fb6bb-778e-42eb-9fb6-cf4b032a5566</trackback:ping>
      <wfw:comment>http://blog.maartenballiauw.be/post/2009/09/10/Joined-The-Lounge-network.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.maartenballiauw.be/syndication.axd?post=d64fb6bb-778e-42eb-9fb6-cf4b032a5566</wfw:commentRss>
    <feedburner:origLink>http://blog.maartenballiauw.be/post.aspx?id=d64fb6bb-778e-42eb-9fb6-cf4b032a5566</feedburner:origLink></item>
  </channel>
</rss>
