<?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>Decaying Code</title>
    <description>Where code comes to die</description>
    <link>http://blog.decayingcode.com/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 2.0.0.36</generator>
    <language>en-US</language>
    <blogChannel:blogRoll>http://blog.decayingcode.com/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.dotnetblogengine.net/syndication.axd</blogChannel:blink>
    <dc:creator>Maxime Rouiller</dc:creator>
    <dc:title>Decaying Code</dc:title>
    <geo:lat>45.508890</geo:lat>
    <geo:long>-73.554170</geo:long>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/DecayingCode" /><feedburner:info uri="decayingcode" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
      <title>Browser Detection is bad. Feature Detection is better.</title>
      <description>&lt;h2&gt;Context (Or a little bit of history)&lt;/h2&gt;
&lt;p&gt;Those who did websites in the beginning of the decade had to work with IE6, Netscape Communicator/Navigator and Opera. Some more browser introduced themselves along the years but most supported different things.&lt;/p&gt;
&lt;p&gt;Netscape supported the blink tag (oh how I hate thee). Internet Explorer supported ActiveX and Opera was not popular enough to think about it.&lt;/p&gt;
&lt;p&gt;We were in an era where people thought of the web as the blue &amp;ldquo;E&amp;rdquo; icon. People were not aware of browsers that much and those who had Netscape probably had it from an AOL promotion.&lt;/p&gt;
&lt;p&gt;Since we wanted to display the same thing to every users as much as possible, people either started detecting browsers to clearly say on which browser their website is supported or they just didn&amp;rsquo;t do any checking at all!&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s the main reason some internal web applications still display &amp;ldquo;Works better with IE6&amp;rdquo;.&lt;/p&gt;
&lt;h2&gt;Browser Detection&lt;/h2&gt;
&lt;p&gt;Browsers back then differed a lot from each other. So we had to know if we could use ActiveX or whether we wanted to piss off our users with a blink tag.&lt;/p&gt;
&lt;p&gt;The rendering of all this of course was different per browsers.&lt;/p&gt;
&lt;p&gt;Here is &lt;a href="http://www.quirksmode.org/js/detect.html"&gt;the script&lt;/a&gt; to detect which browsers you are running. I will not copy it here (too large) but you can see that it grows.&lt;/p&gt;
&lt;p&gt;Once people knew which browser was running, they knew which feature was supported! So everything was perfect, right?&lt;/p&gt;
&lt;p&gt;Not exactly. What if the feature was deprecated in the next version? What if the browser had that functionality disabled by an option? What if a new browser that your script don&amp;rsquo;t know come in? Why couldn&amp;rsquo;t he use that feature if he supported it?&lt;/p&gt;
&lt;p&gt;This caused a lot of problem. Mostly because detecting a browser didn&amp;rsquo;t guarantee you anything beside that the user was sending you a UserAgent string that pleased you.&lt;/p&gt;
&lt;p&gt;The browser detection was broken from the start and something had to be done to detect whether something was going to work or not. Irrespectively of the browser.&lt;/p&gt;
&lt;h2&gt;Feature Detection&lt;/h2&gt;
&lt;p&gt;Then came feature detection. The first real push for it was by Mr. John Resig himself when he posted &lt;a href="http://ejohn.org/blog/future-proofing-javascript-libraries/"&gt;&amp;ldquo;Future-Proofing JavaScript Libraries&amp;rdquo;&lt;/a&gt;. Today, jQuery allow developers to access a ton of features that would have taken individual developers months to develop and maintain. jQuery allows you to implement binding of events without knowing whether you should use &lt;a href="http://msdn.microsoft.com/en-us/library/ms536343(v=vs.85).aspx"&gt;attachEvent&lt;/a&gt; or &lt;a href="https://developer.mozilla.org/en/DOM/element.addEventListener"&gt;addEventListener&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you have the time, go see the development version of jQuery. It&amp;rsquo;s commented and will allow you to find their hacks to offer everyone the same functionalities. This allows you to manipulate the browser without having to know which one it is. It allows you to do Ajax in &lt;a href="http://msdn.microsoft.com/en-us/library/ms537505(v=vs.85).aspx#_id"&gt;IE6 with ActiveX or with IE7&lt;/a&gt; (or higher) with the proper object without knowing if your browser supports ActiveX.&lt;/p&gt;
&lt;p&gt;Today, assuming everyone use a frameworks which smooth the basic differences between the browsers, the only thing you might be checking nowadays is HTML5 feature compatibility.&lt;/p&gt;
&lt;h2&gt;Introducing Modernizr&lt;/h2&gt;
&lt;p&gt;&lt;a href="http://www.modernizr.com/download/"&gt;Modernizr&lt;/a&gt; is a library which does Feature detection and that can be tailor cut to your needs. In its complete version, it allows you to detect easily the following features (not a complete list):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SVG/Canvas support&lt;/li&gt;
&lt;li&gt;Web sockets&lt;/li&gt;
&lt;li&gt;Web SQL Database&lt;/li&gt;
&lt;li&gt;Web workers&lt;/li&gt;
&lt;li&gt;HTML5 Audio/video&lt;/li&gt;
&lt;li&gt;Hash Change event&lt;/li&gt;
&lt;li&gt;WebGL&lt;/li&gt;
&lt;li&gt;Geolocation&lt;/li&gt;
&lt;li&gt;Much more&amp;hellip;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Modernizr once referenced in your webpage allow you to tailor your own code to know if you should gracefully degrade some feature or not.&lt;/p&gt;
&lt;p&gt;Here is an example on how you could use Modernizr when implementing geolocation in your application:&lt;/p&gt;
&lt;pre class="brush: js; gutter: false; toolbar: false;"&gt;Modernizr.load({
  test: Modernizr.geolocation,
  yep : 'geolocation.js',
  nope: 'no-geolocation.js'
});&lt;/pre&gt;
&lt;p&gt;This simple code allows you to load a different JavaScript based upon the feature of a browser.&lt;/p&gt;
&lt;p&gt;Modernizr offer support for IE6+, FireFox 3.5+, Opera 9.6+, Safari 2+, Chrome, iOS, Android, etc.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;With the current quantity of browsers that supports different functionalities at various levels, we should not be implementing for specific browsers but rather for specific features. We would want those feature implemented in all browsers but with the fragmentation of the browser market, it&amp;rsquo;s just not going to happen soon.&lt;/p&gt;
&lt;p&gt;So please, no more &amp;ldquo;This site works better with [INSERT BROWSER]&amp;rdquo;. Target a feature, test for it, and offer different (or no) implementation if the feature is not available. This will make your code cleaner and more efficient.&lt;/p&gt;
&lt;p&gt;So stop the Browser detection madness and embrace the feature detection.&lt;/p&gt;
&lt;p&gt;It might sound counter intuitive to some but it makes sense. So be ready for the future.&lt;/p&gt;
&lt;p&gt;If you are using HTML5, use feature detection rather than browser detection.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/_zQ7DImWenpggWWRdkwGomZ26Wg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_zQ7DImWenpggWWRdkwGomZ26Wg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/_zQ7DImWenpggWWRdkwGomZ26Wg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_zQ7DImWenpggWWRdkwGomZ26Wg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=cRrC31XYJqg:LyElUFMF2EU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=cRrC31XYJqg:LyElUFMF2EU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=cRrC31XYJqg:LyElUFMF2EU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=cRrC31XYJqg:LyElUFMF2EU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=cRrC31XYJqg:LyElUFMF2EU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=cRrC31XYJqg:LyElUFMF2EU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=cRrC31XYJqg:LyElUFMF2EU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DecayingCode/~4/cRrC31XYJqg" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/DecayingCode/~3/cRrC31XYJqg/post.aspx</link>
      <author>maxime@decayingcode.com</author>
      <comments>http://blog.decayingcode.com/post/2012/02/17/Browser-Detection-is-bad-Feature-Detection-is-better.aspx#comment</comments>
      <guid isPermaLink="false">http://blog.decayingcode.com/post.aspx?id=e021231d-b343-4d45-8ac8-5af6019fd20a</guid>
      <pubDate>Fri, 17 Feb 2012 12:44:00 -0800</pubDate>
      <category>jquery</category>
      <category>opinion</category>
      <category>productivity</category>
      <dc:publisher>Maxime Rouiller</dc:publisher>
      <pingback:server>http://blog.decayingcode.com/pingback.axd</pingback:server>
      <pingback:target>http://blog.decayingcode.com/post.aspx?id=e021231d-b343-4d45-8ac8-5af6019fd20a</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blog.decayingcode.com/trackback.axd?id=e021231d-b343-4d45-8ac8-5af6019fd20a</trackback:ping>
      <wfw:comment>http://blog.decayingcode.com/post/2012/02/17/Browser-Detection-is-bad-Feature-Detection-is-better.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.decayingcode.com/syndication.axd?post=e021231d-b343-4d45-8ac8-5af6019fd20a</wfw:commentRss>
    <feedburner:origLink>http://blog.decayingcode.com/post.aspx?id=e021231d-b343-4d45-8ac8-5af6019fd20a</feedburner:origLink></item>
    <item>
      <title>MVC Night in Ottawa with MVP Maxime Rouiller</title>
      <description>&lt;p&gt;I will be talking about MVC and it’s environnement today at the OttawaCommunity.net in… Ottawa.&lt;/p&gt;  &lt;p&gt;For those who attended, or about to attend, here are the slides that are going to be used:&lt;/p&gt;  &lt;p&gt;&lt;a href="https://docs.google.com/presentation/d/1Ptwsm7bt-EnUNaxifNuKyBsKuJF--C9xAGs2m-7x3R0/edit" target="_blank"&gt;The Slides&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RK4FvRRiYaIzTFTJkzHEHYsbVLk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RK4FvRRiYaIzTFTJkzHEHYsbVLk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RK4FvRRiYaIzTFTJkzHEHYsbVLk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RK4FvRRiYaIzTFTJkzHEHYsbVLk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=Zu_Y2PL99X0:LEToTabrsMI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=Zu_Y2PL99X0:LEToTabrsMI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=Zu_Y2PL99X0:LEToTabrsMI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=Zu_Y2PL99X0:LEToTabrsMI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=Zu_Y2PL99X0:LEToTabrsMI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=Zu_Y2PL99X0:LEToTabrsMI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=Zu_Y2PL99X0:LEToTabrsMI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DecayingCode/~4/Zu_Y2PL99X0" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/DecayingCode/~3/Zu_Y2PL99X0/post.aspx</link>
      <author>maxime@decayingcode.com</author>
      <comments>http://blog.decayingcode.com/post/2012/02/02/MVC-Night-in-Ottawa-with-MVP-Maxime-Rouiller.aspx#comment</comments>
      <guid isPermaLink="false">http://blog.decayingcode.com/post.aspx?id=ea38073b-2b9f-4171-887a-42c3078cf9e2</guid>
      <pubDate>Thu, 02 Feb 2012 12:34:41 -0800</pubDate>
      <category>community</category>
      <category>presentation</category>
      <category>event</category>
      <dc:publisher>Maxime Rouiller</dc:publisher>
      <pingback:server>http://blog.decayingcode.com/pingback.axd</pingback:server>
      <pingback:target>http://blog.decayingcode.com/post.aspx?id=ea38073b-2b9f-4171-887a-42c3078cf9e2</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blog.decayingcode.com/trackback.axd?id=ea38073b-2b9f-4171-887a-42c3078cf9e2</trackback:ping>
      <wfw:comment>http://blog.decayingcode.com/post/2012/02/02/MVC-Night-in-Ottawa-with-MVP-Maxime-Rouiller.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.decayingcode.com/syndication.axd?post=ea38073b-2b9f-4171-887a-42c3078cf9e2</wfw:commentRss>
    <feedburner:origLink>http://blog.decayingcode.com/post.aspx?id=ea38073b-2b9f-4171-887a-42c3078cf9e2</feedburner:origLink></item>
    <item>
      <title>Javascript and CSS Minifying/Bundling with the Microsoft.Web.Optimization Nuget package</title>
      <description>&lt;p&gt;So I’ve been wanting to write about this since the build and only gotten around to do it now.&lt;/p&gt;  &lt;p&gt;When you write C# code, you rather have multiple small files with clear separation of concerns. This allow you to have small and clear classes and the compiler will never complain about it. However, in Javascript, you want to have smaller files. Most of the time in the .NET environment, there wasn’t any integrated way of doing so. Either it required an EXE call or outputing .min.js files. &lt;/p&gt;  &lt;p&gt;This caused problems as we had to alter our Development version of our HTML to fit our Production environment. Microsoft released this tid bit early because it’s probably going to be integrated in the .NET 4.5 framework but is making it available to us now. &lt;/p&gt;  &lt;p&gt;Please be aware that “Microsoft.*” DLLs are not part of the official framework and when they do, they will probably be changed namespace to “System.*”.&lt;/p&gt;  &lt;h2&gt;Pre-requisites&lt;/h2&gt;  &lt;p&gt;First, you will need NuGet to install the following packages:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Microsoft.Web.Optimization&lt;/li&gt;    &lt;li&gt;WebActivator&lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;How it works&lt;/h2&gt;  &lt;p&gt;Now, the way the JS/CSS minifying works is that it will dynamically inspect all your files, read them, minify them and then cache the result to be served later. This allow us to modify our files and have all the files re-minified. When one of our JS/CSS file get modified again, this process will restart until either the cache expire or a file change.&lt;/p&gt;  &lt;h2&gt;Setting up the base work&lt;/h2&gt;  &lt;p&gt;For the minify-er to work, it will require the registration of an HttpModule. It’s not already included in the Microsoft.Web.Optimization package but it will be necessary for us to add it if we want it to work.&lt;/p&gt;  &lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;using Microsoft.Web.Infrastructure.DynamicModuleHelper;
using Microsoft.Web.Optimization;
using MvcBackbonePrototype.Bundle;

[assembly: WebActivator.PreApplicationStartMethod(typeof(MvcBackbonePrototype.AppStart.BundleAppStart), &amp;quot;Start&amp;quot;)]

namespace MvcBackbonePrototype.AppStart
{
    public static class BundleAppStart 
    {
        public static void Start()
        {
            DynamicModuleUtility.RegisterModule(typeof (BundleModule));
            RegisterFolders();
        }

        private static void RegisterFolders()
        {
            // configure Microsoft.Web.Optimization
        }
    }
}&lt;/pre&gt;

&lt;p&gt;The previous code will do the following, when your application start, it will register a dynamic HttpModule.&lt;/p&gt;

&lt;p&gt;Now that the base work is done, we’ll jump right ahead to the configuration of the folders.&lt;/p&gt;

&lt;h2&gt;Configuring the package&lt;/h2&gt;

&lt;p&gt;Now that the HttpModule is properly registered, we need to tell the Module when to activate itself. In my specific scenario, I wanted to have jQuery, underscore.js and Backbone.js in that specific order. &lt;/p&gt;

&lt;p&gt;By default, the Module will load most core frameworks first (jQuery, MooTools, prototype, scriptaculous) and then load the rest of the files that doesn’t match the wildcards after. The filters are done so that jQuery plugins will load after the jQuery core library and jQuery UI will load after jQuery.&lt;/p&gt;

&lt;p&gt;However, there is nothing done for underscore.js and Backbone.js.&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;private static void RegisterFolders()
{
    var js = new DynamicFolderBundle(&amp;quot;js&amp;quot;, typeof(JsMinify), &amp;quot;*.js&amp;quot;, false);
    BundleTable.Bundles.Add(js);
}&lt;/pre&gt;

&lt;p&gt;The previous code correctly configure the module to minify all files in a folder by just adding the suffix “js” to the folder (eg.: /Scripts/js).&lt;/p&gt;

&lt;p&gt;However, it will register the the other modules in alphabetical order rather than the proper order. &lt;/p&gt;

&lt;p&gt;Let’s fix that.&lt;/p&gt;

&lt;h2&gt;Custom Orderer&lt;/h2&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;public class BackboneOrderer: DefaultBundleOrderer
{
    public override IEnumerable&amp;lt;FileInfo&amp;gt; OrderFiles(BundleContext context, IEnumerable&amp;lt;FileInfo&amp;gt; files)
    {
        context.BundleCollection.AddDefaultFileOrderings();

        var backboneOrdering = new BundleFileSetOrdering(&amp;quot;backbone&amp;quot;);
        backboneOrdering.Files.Add(&amp;quot;underscore.*&amp;quot;);
        backboneOrdering.Files.Add(&amp;quot;backbone.*&amp;quot;);
        context.BundleCollection.FileSetOrderList.Add(backboneOrdering);

        return base.OrderFiles(context, files);
    }
}&lt;/pre&gt;

&lt;p&gt;We first inherit from the default order. Then, we add the default file ordering which will take care of the jQuery ordering for us. Then, we add the other files that we require to the list. The only thing left is to alter our RegisterFolders method to fix that.&lt;/p&gt;

&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;private static void RegisterFolders()
{
    var js = new DynamicFolderBundle(&amp;quot;js&amp;quot;, typeof(JsMinify), &amp;quot;*.js&amp;quot;, false);
    js.Orderer = new BackboneOrderer();
    BundleTable.Bundles.Add(js);
}&lt;/pre&gt;

&lt;p&gt;That’s it. We are nearly done!&lt;/p&gt;

&lt;p&gt;Modifying your _Layout.cshtml / masterpage&lt;/p&gt;

&lt;p&gt;My masterpage head section first looked a lot like this:&lt;/p&gt;

&lt;pre class="brush: xml; gutter: false; toolbar: false;"&gt;&amp;lt;script src=&amp;quot;@Url.Content(&amp;quot;~/Scripts/Framework/jquery-1.7.1.min.js&amp;quot;)&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src=&amp;quot;@Url.Content(&amp;quot;~/Scripts/Framework/underscore.min.js&amp;quot;)&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src=&amp;quot;@Url.Content(&amp;quot;~/Scripts/Framework/backbone.min.js&amp;quot;)&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;

&lt;p&gt;This was of course replaced by the following:&lt;/p&gt;

&lt;pre class="brush: xml; gutter: false; toolbar: false;"&gt;&amp;lt;script src=&amp;quot;@Url.Content(&amp;quot;~/Scripts/Framework/js&amp;quot;)&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;

&lt;p&gt;And that’s all! All your files will be minimized, bundled and properly cached.&lt;/p&gt;

&lt;h2&gt;Bonus&lt;/h2&gt;

&lt;p&gt;If you want to have your URLs with a “version number” on it, I suggest that you use the following methods to resolve your URLs instead of the MVC way:&lt;/p&gt;

&lt;pre class="brush: xml; gutter: false; toolbar: false;"&gt;&amp;lt;script src=&amp;quot;@Microsoft.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl(&amp;quot;~/Scripts/Framework/js&amp;quot;, true)&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QNewVVnsHNW_TzPHN0WlbUIvqmw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QNewVVnsHNW_TzPHN0WlbUIvqmw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QNewVVnsHNW_TzPHN0WlbUIvqmw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QNewVVnsHNW_TzPHN0WlbUIvqmw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=zk4HdDftohQ:6hZhMNnjkic:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=zk4HdDftohQ:6hZhMNnjkic:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=zk4HdDftohQ:6hZhMNnjkic:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=zk4HdDftohQ:6hZhMNnjkic:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=zk4HdDftohQ:6hZhMNnjkic:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=zk4HdDftohQ:6hZhMNnjkic:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=zk4HdDftohQ:6hZhMNnjkic:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DecayingCode/~4/zk4HdDftohQ" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/DecayingCode/~3/zk4HdDftohQ/post.aspx</link>
      <author>maxime@decayingcode.com</author>
      <comments>http://blog.decayingcode.com/post/2012/01/23/Javascript-and-CSS-MinifyingBundling-with-the-MicrosoftWebOptimization-Nuget-package.aspx#comment</comments>
      <guid isPermaLink="false">http://blog.decayingcode.com/post.aspx?id=1d6b3415-0bb0-44bb-a012-b6c677978168</guid>
      <pubDate>Mon, 23 Jan 2012 06:47:14 -0800</pubDate>
      <category>asp.net</category>
      <category>nuget</category>
      <category>mvc</category>
      <dc:publisher>Maxime Rouiller</dc:publisher>
      <pingback:server>http://blog.decayingcode.com/pingback.axd</pingback:server>
      <pingback:target>http://blog.decayingcode.com/post.aspx?id=1d6b3415-0bb0-44bb-a012-b6c677978168</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blog.decayingcode.com/trackback.axd?id=1d6b3415-0bb0-44bb-a012-b6c677978168</trackback:ping>
      <wfw:comment>http://blog.decayingcode.com/post/2012/01/23/Javascript-and-CSS-MinifyingBundling-with-the-MicrosoftWebOptimization-Nuget-package.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.decayingcode.com/syndication.axd?post=1d6b3415-0bb0-44bb-a012-b6c677978168</wfw:commentRss>
    <feedburner:origLink>http://blog.decayingcode.com/post.aspx?id=1d6b3415-0bb0-44bb-a012-b6c677978168</feedburner:origLink></item>
    <item>
      <title>How to insert page breaks in printed web pages using only CSS?</title>
      <description>&lt;p&gt;So one of my co-worker had to print a “report”. I say report but it’s more like they wanted the page printed but just more compact and less fluffy/pretty content. Like always, people tend to bring solutions instead of problems and they asked me how long it would take me to do that in SSRS.&lt;/p&gt;  &lt;p&gt;Of course, I gave my evaluation on how long it should take but then… we stumbled into problems. My co-worker only have Visual Studio 2010 installed. SSRS requires you to have BIDS which uses Visual Studio 2008. Then, we have SQL Server 2008 R2 installed on our machine but no-R2 on our deployment server. This quickly became a mess.&lt;/p&gt;  &lt;p&gt;Then after taking the time to look at the problem, we asked: “Why couldn’t we just print the web page?”&lt;/p&gt;  &lt;p&gt;Well for starters, the requirements we had was there was a need for a page break at certain predictable location. &lt;/p&gt;  &lt;p&gt;After searching a bit, I came up with this solution directly from W3C (and a bit other sources).&lt;/p&gt;  &lt;pre class="brush: css; toolbar: false;"&gt;@media print {
    .pagebreak {
        page-break-before: always;
    }
}&lt;/pre&gt;

&lt;p&gt;And that’s it. Just add the class to the element that should be on a new page and it works.&lt;/p&gt;

&lt;p&gt;Now, what about compatibility you say?&lt;/p&gt;

&lt;p&gt;It should be compatible with IE (all current versions down to 6), FireFox (all latest versions), Chrome (tested on v16) and Opera (all versions).&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/UmEf94zydT0ZIeLCCZ4auCNkWSg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/UmEf94zydT0ZIeLCCZ4auCNkWSg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/UmEf94zydT0ZIeLCCZ4auCNkWSg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/UmEf94zydT0ZIeLCCZ4auCNkWSg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=Tx6ybKcECG0:AcQsN8lff2U:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=Tx6ybKcECG0:AcQsN8lff2U:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=Tx6ybKcECG0:AcQsN8lff2U:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=Tx6ybKcECG0:AcQsN8lff2U:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=Tx6ybKcECG0:AcQsN8lff2U:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=Tx6ybKcECG0:AcQsN8lff2U:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=Tx6ybKcECG0:AcQsN8lff2U:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DecayingCode/~4/Tx6ybKcECG0" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/DecayingCode/~3/Tx6ybKcECG0/post.aspx</link>
      <author>maxime@decayingcode.com</author>
      <comments>http://blog.decayingcode.com/post/2012/01/05/How-to-insert-page-breaks-in-printed-web-pages-using-only-CSS.aspx#comment</comments>
      <guid isPermaLink="false">http://blog.decayingcode.com/post.aspx?id=287488b9-5424-4309-ae7e-beb9984715aa</guid>
      <pubDate>Thu, 05 Jan 2012 06:44:31 -0800</pubDate>
      <category>design</category>
      <category>css</category>
      <dc:publisher>Maxime Rouiller</dc:publisher>
      <pingback:server>http://blog.decayingcode.com/pingback.axd</pingback:server>
      <pingback:target>http://blog.decayingcode.com/post.aspx?id=287488b9-5424-4309-ae7e-beb9984715aa</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blog.decayingcode.com/trackback.axd?id=287488b9-5424-4309-ae7e-beb9984715aa</trackback:ping>
      <wfw:comment>http://blog.decayingcode.com/post/2012/01/05/How-to-insert-page-breaks-in-printed-web-pages-using-only-CSS.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.decayingcode.com/syndication.axd?post=287488b9-5424-4309-ae7e-beb9984715aa</wfw:commentRss>
    <feedburner:origLink>http://blog.decayingcode.com/post.aspx?id=287488b9-5424-4309-ae7e-beb9984715aa</feedburner:origLink></item>
    <item>
      <title>DevCamp Montreal 2011– jQuery Presentation</title>
      <description>&lt;p&gt;For those who will attend tonight’s presentation fast talk on jQuery, here is my presentation file that I will be using tonight.&lt;/p&gt;  &lt;p&gt;It’s available for download by clicking the link bellow! &lt;/p&gt;  &lt;p&gt;&lt;a href="https://docs.google.com/presentation/d/15BqdifZiiMBt-6Ho9EJvOTlM0pasg7-Qf6Smg0baF_0/edit"&gt;Download the presentation file here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Lz1ZX8kRE8VkfobJ096kASg6uNY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Lz1ZX8kRE8VkfobJ096kASg6uNY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Lz1ZX8kRE8VkfobJ096kASg6uNY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Lz1ZX8kRE8VkfobJ096kASg6uNY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=vjYEr6YNrQQ:iOwkmJ8nl2c:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=vjYEr6YNrQQ:iOwkmJ8nl2c:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=vjYEr6YNrQQ:iOwkmJ8nl2c:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=vjYEr6YNrQQ:iOwkmJ8nl2c:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=vjYEr6YNrQQ:iOwkmJ8nl2c:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=vjYEr6YNrQQ:iOwkmJ8nl2c:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=vjYEr6YNrQQ:iOwkmJ8nl2c:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DecayingCode/~4/vjYEr6YNrQQ" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/DecayingCode/~3/vjYEr6YNrQQ/post.aspx</link>
      <author>maxime@decayingcode.com</author>
      <comments>http://blog.decayingcode.com/post/2011/11/29/DevCamp-Montreal-2011–-jQuery-Presentation.aspx#comment</comments>
      <guid isPermaLink="false">http://blog.decayingcode.com/post.aspx?id=97fb9d9f-c82f-4d42-bc31-9378378715fd</guid>
      <pubDate>Tue, 29 Nov 2011 13:33:07 -0800</pubDate>
      <category>jquery</category>
      <category>presentation</category>
      <dc:publisher>Maxime Rouiller</dc:publisher>
      <pingback:server>http://blog.decayingcode.com/pingback.axd</pingback:server>
      <pingback:target>http://blog.decayingcode.com/post.aspx?id=97fb9d9f-c82f-4d42-bc31-9378378715fd</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blog.decayingcode.com/trackback.axd?id=97fb9d9f-c82f-4d42-bc31-9378378715fd</trackback:ping>
      <wfw:comment>http://blog.decayingcode.com/post/2011/11/29/DevCamp-Montreal-2011–-jQuery-Presentation.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.decayingcode.com/syndication.axd?post=97fb9d9f-c82f-4d42-bc31-9378378715fd</wfw:commentRss>
    <feedburner:origLink>http://blog.decayingcode.com/post.aspx?id=97fb9d9f-c82f-4d42-bc31-9378378715fd</feedburner:origLink></item>
    <item>
      <title>Siberix – Footer row higher than they should be</title>
      <description>&lt;p&gt;So I’ve had to build some reports with &lt;a href="http://www.siberix.com/"&gt;Siberix&lt;/a&gt; in the last few days and I had some less than pleasing results. I had a grid that was overflowing vertically but for some reason, the last row on the page would take 2-3 times more space than necessary.&lt;/p&gt;  &lt;p&gt;After printing the page and looking at the results many times… something clicked when I saw the footer row that I had added. The blank space that was left was exactly the same size as my footer.&lt;/p&gt;  &lt;p&gt;So maybe it’s a bug, maybe it’s not but Siberix let’s itself some room on every page to render the footer “in case” that it’s the last page. No concept what so ever of where he’s at when rendering the PDF.&lt;/p&gt;  &lt;p&gt;The solution? Make the footer outside the IGrid and it won’t glitch anymore. And yes, I tried to set the IFooter.Repeat to false.&lt;/p&gt;  &lt;p&gt;I can understand that a product have bugs but the worst part is that it’s a paying tool and no community built around it like Telerik, ReSharper or other third party tools. My last try was with &lt;a href="http://www.stackoverflow.com"&gt;Stackoverflow&lt;/a&gt; but didn’t have any luck either.&lt;/p&gt;  &lt;p&gt;Siberix, if you want to increase your sales, make sure you have a community behind it. Just a friendly advice.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Emb5JuYSdhWD4iKOhD7eoLtJO_E/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Emb5JuYSdhWD4iKOhD7eoLtJO_E/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Emb5JuYSdhWD4iKOhD7eoLtJO_E/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Emb5JuYSdhWD4iKOhD7eoLtJO_E/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=lKGD434VaHs:Nn0bh_Vx_sY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=lKGD434VaHs:Nn0bh_Vx_sY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=lKGD434VaHs:Nn0bh_Vx_sY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=lKGD434VaHs:Nn0bh_Vx_sY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=lKGD434VaHs:Nn0bh_Vx_sY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=lKGD434VaHs:Nn0bh_Vx_sY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=lKGD434VaHs:Nn0bh_Vx_sY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DecayingCode/~4/lKGD434VaHs" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/DecayingCode/~3/lKGD434VaHs/post.aspx</link>
      <author>maxime@decayingcode.com</author>
      <comments>http://blog.decayingcode.com/post/2011/11/23/Siberix-–-Footer-row-higher-than-they-should-be.aspx#comment</comments>
      <guid isPermaLink="false">http://blog.decayingcode.com/post.aspx?id=1bc11928-200c-4587-ab0d-708d4d6556f8</guid>
      <pubDate>Wed, 23 Nov 2011 12:56:39 -0800</pubDate>
      <category>software</category>
      <dc:publisher>Maxime Rouiller</dc:publisher>
      <pingback:server>http://blog.decayingcode.com/pingback.axd</pingback:server>
      <pingback:target>http://blog.decayingcode.com/post.aspx?id=1bc11928-200c-4587-ab0d-708d4d6556f8</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blog.decayingcode.com/trackback.axd?id=1bc11928-200c-4587-ab0d-708d4d6556f8</trackback:ping>
      <wfw:comment>http://blog.decayingcode.com/post/2011/11/23/Siberix-–-Footer-row-higher-than-they-should-be.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.decayingcode.com/syndication.axd?post=1bc11928-200c-4587-ab0d-708d4d6556f8</wfw:commentRss>
    <feedburner:origLink>http://blog.decayingcode.com/post.aspx?id=1bc11928-200c-4587-ab0d-708d4d6556f8</feedburner:origLink></item>
    <item>
      <title>I’ve just been nominated ASP.NET MVP</title>
      <description>&lt;p&gt;First of all, I’m extremely happy with my nomination as an ASP.NET MVP. I did a lot of presentations in the past 2 years and I’m happy that I’m considered for this award.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blog.decayingcode.com/image.axd?picture=MVP.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="MVP" border="0" alt="MVP" src="http://blog.decayingcode.com/image.axd?picture=MVP_thumb.png" width="119" height="184" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I would like to thank everyone who nominated me and helped me get where I am today.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.mariocardinal.com/"&gt;Mario Cardinal&lt;/a&gt; helped me by backing me with the nomination. &lt;a href="http://blog.decarufel.net/"&gt;Éric De Carufel&lt;/a&gt; is also a big part of my nomination since we started a small group (ALT.NET) more than a year ago. Since then, we’ve been working non-stop in presenting and “one-upping” each other. I would also thank &lt;a href="http://blogs.msdn.com/b/joelq/"&gt;Joël Quimper&lt;/a&gt; for his help and my boss Yves Forget for helping me give time to those presentations.&lt;/p&gt;  &lt;p&gt;Most of my presentations has been done at the &lt;a href="http://www.dotnetmontreal.com/"&gt;.NET Montreal Group&lt;/a&gt; so I would lastly thank &lt;a href="http://guy.dotnet-expertise.com/"&gt;Guy Barette&lt;/a&gt; for the opportunities he gave me as well as the inclusion of our group inside the big .NET Montreal community. &lt;/p&gt;  &lt;p&gt;So I’ll be participating more in the following months and I will push ASP.NET as hard as before within Montreal.&lt;/p&gt;  &lt;p&gt;Thanks again,&lt;/p&gt;  &lt;p&gt;-Maxime Rouiller&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/WcgKE2DmpRyLi8_NdseZY3lufQg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WcgKE2DmpRyLi8_NdseZY3lufQg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/WcgKE2DmpRyLi8_NdseZY3lufQg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WcgKE2DmpRyLi8_NdseZY3lufQg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=wpr0mp-o2ns:aVH6nlTbquw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=wpr0mp-o2ns:aVH6nlTbquw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=wpr0mp-o2ns:aVH6nlTbquw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=wpr0mp-o2ns:aVH6nlTbquw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=wpr0mp-o2ns:aVH6nlTbquw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=wpr0mp-o2ns:aVH6nlTbquw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=wpr0mp-o2ns:aVH6nlTbquw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DecayingCode/~4/wpr0mp-o2ns" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/DecayingCode/~3/wpr0mp-o2ns/post.aspx</link>
      <author>maxime@decayingcode.com</author>
      <comments>http://blog.decayingcode.com/post/2011/04/01/I’ve-just-been-nominated-ASPNET-MVP.aspx#comment</comments>
      <guid isPermaLink="false">http://blog.decayingcode.com/post.aspx?id=3b135c59-e719-4387-8aa1-febc54b2d9c0</guid>
      <pubDate>Fri, 01 Apr 2011 11:47:22 -0800</pubDate>
      <category>mvp</category>
      <category>community</category>
      <dc:publisher>Maxime Rouiller</dc:publisher>
      <pingback:server>http://blog.decayingcode.com/pingback.axd</pingback:server>
      <pingback:target>http://blog.decayingcode.com/post.aspx?id=3b135c59-e719-4387-8aa1-febc54b2d9c0</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blog.decayingcode.com/trackback.axd?id=3b135c59-e719-4387-8aa1-febc54b2d9c0</trackback:ping>
      <wfw:comment>http://blog.decayingcode.com/post/2011/04/01/I’ve-just-been-nominated-ASPNET-MVP.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.decayingcode.com/syndication.axd?post=3b135c59-e719-4387-8aa1-febc54b2d9c0</wfw:commentRss>
    <feedburner:origLink>http://blog.decayingcode.com/post.aspx?id=3b135c59-e719-4387-8aa1-febc54b2d9c0</feedburner:origLink></item>
    <item>
      <title>Ajax with jQuery and ASP.NET MVC</title>
      <description>&lt;h1&gt;Requirements&lt;/h1&gt;  &lt;ul&gt;   &lt;li&gt;ASP.NET MVC 2 (or higher) &lt;/li&gt;    &lt;li&gt;jQuery (latest version or the one shipped with MVC) &lt;/li&gt;    &lt;li&gt;&lt;a href="http://docs.jquery.com"&gt;http://docs.jquery.com&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;h1&gt;What should I learn first?&lt;/h1&gt;  &lt;p&gt;When doing AJAX with ASP.NET MVC, there is no “UpdatePanel” or high level abstraction that helps you do all the magic. You need to get your hands dirty. That means learning how to do actual JavaScript without having the framework do all the job for you.&lt;/p&gt;  &lt;p&gt;My favorite tool is jQuery when it comes to JavaScript. It’s simple, small and allows you to do in a few line of codes in 5 minutes what would take me 3 days an 2000 lines of code.&lt;/p&gt;  &lt;p&gt;What should be on your reading list?&lt;/p&gt;  &lt;h2&gt;Document Ready Event&lt;/h2&gt;  &lt;p&gt;First, do not forget to put any jQuery code inside the following snippet:&lt;/p&gt;  &lt;pre class="brush: js;"&gt;$(document).ready(function () {
    // all code need to go there.
});&lt;/pre&gt;

&lt;h2&gt;&lt;a href="http://api.jquery.com/category/selectors/"&gt;Selectors&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;The three most important selectors (in my opinion) are the following : &lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://api.jquery.com/id-selector/"&gt;ID selector&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;&lt;a href="http://api.jquery.com/class-selector/"&gt;Class selector&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;&lt;a href="http://api.jquery.com/attribute-equals-selector/"&gt;Attribute selector&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those three selectors will include around 80 to 90% of all the selector you will require. The others, you can pick up along the way!&lt;/p&gt;

&lt;h2&gt;&lt;a href="http://api.jquery.com/category/manipulation/"&gt;Manipulation&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;Here, we are talking about manipulating elements from the HTML page. We will need those since they are required for removing and adding HTML into the page. It’s basically what the UpdatePanel for WebForms do but we’ll do it manually and be more specific in what we want. &lt;/p&gt;

&lt;p&gt;Here what I consider essential :&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://api.jquery.com/remove/"&gt;remove()&lt;/a&gt; – Allows you to remove an element from the DOM. This is useful when wanting to remove an element directly. &lt;/li&gt;

  &lt;li&gt;&lt;a href="http://api.jquery.com/append/"&gt;append()&lt;/a&gt;/&lt;a href="http://api.jquery.com/prepend/"&gt;prepend()&lt;/a&gt; – Allows you to insert an element inside the selected tags (either before or after the existing elements of that tag) &lt;/li&gt;

  &lt;li&gt;&lt;a href="http://api.jquery.com/replaceWith/"&gt;replaceWith()&lt;/a&gt; – Replace the element with what’s given in parameters. When using this, make sure that the replaced element have the same usable selector or it will harder to reselect that element. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And now, we have nearly everything that we need to start being AJAX-y!&lt;/p&gt;

&lt;h1&gt;I already know all that, let me do AJAX!&lt;/h1&gt;

&lt;p&gt;So what’s the easiest with jQuery to do AJAX?&lt;/p&gt;

&lt;h2&gt;&lt;a href="http://api.jquery.com/jQuery.get/"&gt;$.get()&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;This method will basically do an HTTP Get on the selected URL and return the data inside the success function callback. &lt;/p&gt;

&lt;p&gt;Let’s say I want to add the result of my AJAX request to the following tag: &lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;div id=&amp;quot;result&amp;quot;&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;

&lt;p&gt;It would be as easy as doing this :&lt;/p&gt;

&lt;pre class="brush: js;"&gt;$.get('/Controller/Action/', null, function (data) {
    $(&amp;quot;#result&amp;quot;).empty(); // clears the content
    $(&amp;quot;#result&amp;quot;).append(data); // append the data into the div
});&lt;/pre&gt;

&lt;p&gt;Wasn’t that easy? &lt;/p&gt;

&lt;h1&gt;The MVC Side&lt;/h1&gt;

&lt;p&gt;Of course, if your MVC Controller is returning an JsonResult, you could use $.getJSON instead and data would be an object instead of pure HTML. In fact, your controller can even return a simple string and it would work. But how do you make your controller returns only what you need? Actions can be split in 2 with MVC to respond differently whether the request is standard or an AJAX request. Here is what it would look like: &lt;/p&gt;

&lt;pre class="brush: c#;"&gt;public ActionResult MyAction() 
{
    if(Request.IsAjaxRequest())
        return View(&amp;quot;nameOfMyPartialView&amp;quot;);
    else
        return View();
}&lt;/pre&gt;

&lt;p&gt;That’s it! And now if you want to return an object as JSON:&lt;/p&gt;

&lt;pre class="brush: c#;"&gt;public ActionResult AnotherAction()
{
    if(Request.IsAjaxRequest())
    {
        // The following line return Json to AJAX requests
        return Json(new { name = &amp;quot;Maxime Rouiller&amp;quot;}, JsonRequestBehavior.AllowGet);
    }

    // we still return normal HTML to standard requests.
    return View();
}&lt;/pre&gt;

&lt;p&gt;I hope you enjoyed this small example. If you are still curious or if you are simply stuck with something, ask away!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MLwwVo0VTr96FJyjmITql2lWeZY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MLwwVo0VTr96FJyjmITql2lWeZY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MLwwVo0VTr96FJyjmITql2lWeZY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MLwwVo0VTr96FJyjmITql2lWeZY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=NCrZIFmtXWY:bGuKJuJbaNo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=NCrZIFmtXWY:bGuKJuJbaNo:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=NCrZIFmtXWY:bGuKJuJbaNo:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=NCrZIFmtXWY:bGuKJuJbaNo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=NCrZIFmtXWY:bGuKJuJbaNo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=NCrZIFmtXWY:bGuKJuJbaNo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=NCrZIFmtXWY:bGuKJuJbaNo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DecayingCode/~4/NCrZIFmtXWY" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/DecayingCode/~3/NCrZIFmtXWY/post.aspx</link>
      <author>maxime@decayingcode.com</author>
      <comments>http://blog.decayingcode.com/post/2011/03/14/Ajax-with-jQuery-and-ASPNET-MVC.aspx#comment</comments>
      <guid isPermaLink="false">http://blog.decayingcode.com/post.aspx?id=59397fe6-c12c-45d7-9817-70cc9580ab38</guid>
      <pubDate>Mon, 14 Mar 2011 10:54:40 -0800</pubDate>
      <category>mvc</category>
      <category>jquery</category>
      <category>ajax</category>
      <dc:publisher>Maxime Rouiller</dc:publisher>
      <pingback:server>http://blog.decayingcode.com/pingback.axd</pingback:server>
      <pingback:target>http://blog.decayingcode.com/post.aspx?id=59397fe6-c12c-45d7-9817-70cc9580ab38</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blog.decayingcode.com/trackback.axd?id=59397fe6-c12c-45d7-9817-70cc9580ab38</trackback:ping>
      <wfw:comment>http://blog.decayingcode.com/post/2011/03/14/Ajax-with-jQuery-and-ASPNET-MVC.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.decayingcode.com/syndication.axd?post=59397fe6-c12c-45d7-9817-70cc9580ab38</wfw:commentRss>
    <feedburner:origLink>http://blog.decayingcode.com/post.aspx?id=59397fe6-c12c-45d7-9817-70cc9580ab38</feedburner:origLink></item>
    <item>
      <title>NuGet + Visual Studio 2010 + TFS = Warning</title>
      <description>&lt;p&gt;Someone asked me if adding a package through NuGet to a Source Controlled project would add the folder “packages” to TFS.&lt;/p&gt;  &lt;p&gt;Well I got the answer today and it’s “No”.&lt;/p&gt;  &lt;p&gt;Make sure you go inside Source Control Explorer and add that folder. Make sure to also include everything since DLLs are normally excluded by default.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3VZ34GYHeJt6kvtJW_N3zPA6rW8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3VZ34GYHeJt6kvtJW_N3zPA6rW8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3VZ34GYHeJt6kvtJW_N3zPA6rW8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3VZ34GYHeJt6kvtJW_N3zPA6rW8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=HPLhEc5rnZ4:zcMtEkF3kfM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=HPLhEc5rnZ4:zcMtEkF3kfM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=HPLhEc5rnZ4:zcMtEkF3kfM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=HPLhEc5rnZ4:zcMtEkF3kfM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=HPLhEc5rnZ4:zcMtEkF3kfM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=HPLhEc5rnZ4:zcMtEkF3kfM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=HPLhEc5rnZ4:zcMtEkF3kfM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DecayingCode/~4/HPLhEc5rnZ4" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/DecayingCode/~3/HPLhEc5rnZ4/post.aspx</link>
      <author>maxime@decayingcode.com</author>
      <comments>http://blog.decayingcode.com/post/2011/03/02/NuGet-+-Visual-Studio-2010-+-TFS-=-Warning.aspx#comment</comments>
      <guid isPermaLink="false">http://blog.decayingcode.com/post.aspx?id=1aec8fc2-6bb4-4c85-988a-1e5269dd7eb8</guid>
      <pubDate>Wed, 02 Mar 2011 08:44:39 -0800</pubDate>
      <category>tfs</category>
      <category>visual studio</category>
      <category>nuget</category>
      <dc:publisher>Maxime Rouiller</dc:publisher>
      <pingback:server>http://blog.decayingcode.com/pingback.axd</pingback:server>
      <pingback:target>http://blog.decayingcode.com/post.aspx?id=1aec8fc2-6bb4-4c85-988a-1e5269dd7eb8</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blog.decayingcode.com/trackback.axd?id=1aec8fc2-6bb4-4c85-988a-1e5269dd7eb8</trackback:ping>
      <wfw:comment>http://blog.decayingcode.com/post/2011/03/02/NuGet-+-Visual-Studio-2010-+-TFS-=-Warning.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.decayingcode.com/syndication.axd?post=1aec8fc2-6bb4-4c85-988a-1e5269dd7eb8</wfw:commentRss>
    <feedburner:origLink>http://blog.decayingcode.com/post.aspx?id=1aec8fc2-6bb4-4c85-988a-1e5269dd7eb8</feedburner:origLink></item>
    <item>
      <title>Is the Ajax Control Toolkit dead?</title>
      <description>&lt;p&gt;So I’ve got an engagement to speak about Ajax with Visual Studio 2010. Of course, I’m talking about jQuery but there is obviously the Ajax Control Toolkit available for the people who are still on ASP.NET WebForm.&lt;/p&gt;  &lt;p&gt;With such a huge focus right now on ASP.NET MVC, is the Ajax Control Toolkit still relevant?&lt;/p&gt;  &lt;p&gt;The &lt;a href="http://www.asp.net/ajax/ajaxcontroltoolkit/samples/"&gt;website&lt;/a&gt; is still there, the link toward the forums doesn’t work anymore and of course there is this gem :&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;AJAX Control Toolkit Release Notes - September 2009 Release Version 3.0.30930&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;We are 1 year and a half since the last major release. Of course, the &lt;a href="http://ajaxcontroltoolkit.codeplex.com/"&gt;CodePlex project&lt;/a&gt; is still there but the &lt;a href="http://ajaxcontroltoolkit.codeplex.com/releases/view/43475#ReviewsAnchor"&gt;reviews&lt;/a&gt; are not encouraging me to use it.&lt;/p&gt;  &lt;p&gt;Hell, the project could not even be mentioned as &lt;a href="http://ajaxcontroltoolkit.codeplex.com/SourceControl/list/changesets"&gt;actively maintained&lt;/a&gt; anymore. One commit a month is hardly what I call support for such a project.&lt;/p&gt;  &lt;p&gt;So the question remains… is it still relevant today? Will it ever be updated in the future?&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5p4DJdZsHSwikgvXFO8QaH97iuA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5p4DJdZsHSwikgvXFO8QaH97iuA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5p4DJdZsHSwikgvXFO8QaH97iuA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5p4DJdZsHSwikgvXFO8QaH97iuA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=oHV8zKxVT34:to6r2MRrZOk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=oHV8zKxVT34:to6r2MRrZOk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=oHV8zKxVT34:to6r2MRrZOk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=oHV8zKxVT34:to6r2MRrZOk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=oHV8zKxVT34:to6r2MRrZOk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DecayingCode?a=oHV8zKxVT34:to6r2MRrZOk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DecayingCode?i=oHV8zKxVT34:to6r2MRrZOk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DecayingCode/~4/oHV8zKxVT34" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/DecayingCode/~3/oHV8zKxVT34/post.aspx</link>
      <author>maxime@decayingcode.com</author>
      <comments>http://blog.decayingcode.com/post/2011/02/28/Is-the-Ajax-Control-Toolkit-dead.aspx#comment</comments>
      <guid isPermaLink="false">http://blog.decayingcode.com/post.aspx?id=1ba684d6-9292-4a44-969a-5d6f064f766b</guid>
      <pubDate>Mon, 28 Feb 2011 15:23:20 -0800</pubDate>
      <category>asp.net</category>
      <category>ajax</category>
      <dc:publisher>Maxime Rouiller</dc:publisher>
      <pingback:server>http://blog.decayingcode.com/pingback.axd</pingback:server>
      <pingback:target>http://blog.decayingcode.com/post.aspx?id=1ba684d6-9292-4a44-969a-5d6f064f766b</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blog.decayingcode.com/trackback.axd?id=1ba684d6-9292-4a44-969a-5d6f064f766b</trackback:ping>
      <wfw:comment>http://blog.decayingcode.com/post/2011/02/28/Is-the-Ajax-Control-Toolkit-dead.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blog.decayingcode.com/syndication.axd?post=1ba684d6-9292-4a44-969a-5d6f064f766b</wfw:commentRss>
    <feedburner:origLink>http://blog.decayingcode.com/post.aspx?id=1ba684d6-9292-4a44-969a-5d6f064f766b</feedburner:origLink></item>
  </channel>
</rss>

