<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2titles.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemtitles.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
    <channel>
        <title>Stephen Walther on ASP.NET MVC</title>
        <link>http://stephenwalther.com/blog/Default.aspx</link>
        <description />
        <language>en-US</language>
        <copyright>Stephen Walther</copyright>
        <managingEditor>Stephen.Walther@Microsoft.com</managingEditor>
        <generator>Subtext Version 2.0.0.43</generator>
        <image>
            <title>Stephen Walther on ASP.NET MVC</title>
            <url>http://stephenwalther.com/blog/images/RSS2Image.gif</url>
            <link>http://stephenwalther.com/blog/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/StephenWalther" type="application/rss+xml" /><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FStephenWalther" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FStephenWalther" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/StephenWalther" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FStephenWalther" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FStephenWalther" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FStephenWalther" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2FStephenWalther" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2FStephenWalther" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://www.addtoany.com/?linkname=Stephen%20Walther%20on%20ASP.NET%20MVC&amp;linkurl=http%3A%2F%2Ffeeds.feedburner.com%2FStephenWalther&amp;type=feed" src="http://www.addtoany.com/addfr-b.gif">Add to Any Feed Reader</feedburner:feedFlare><feedburner:browserFriendly>Get the latest news, tips, and articles on ASP.NET MVC by subscribing to Stephen Walther's blog.</feedburner:browserFriendly><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
            <title>Speaking at Tech-Ed Europe Next Week</title>
            <link>http://feedproxy.google.com/~r/StephenWalther/~3/j7TwrQ70FZE/speaking-at-tech-ed-europe-next-week.aspx</link>
            <description>&lt;p&gt;I’m going to Berlin! Next week, I’m giving talks at Tech-Ed Europe on two of my favorite topics:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;b&gt;What's New in Microsoft ASP.NET Model-View-Controller&lt;/b&gt;       &lt;p&gt;ASP.NET Model-View-Controller (MVC) 2 introduces new features to make you more productive when building an ASP.NET MVC application. Templated helpers allow automatically associatiating edit and display elements with data types. Areas provide a means of dividing a large Web application into multiple projects. Data annotations allow attaching metadata attributes on a model to control validation.&lt;/p&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;ul&gt;   &lt;li&gt;&lt;b&gt;Microsoft ASP.NET AJAX: Taking AJAX to the Next Level&lt;/b&gt;       &lt;p&gt;Hear how ASP.NET AJAX 4.0 makes building pure client-side AJAX Web applications even easier, and watch us build an entire data-driven ASP.NET AJAX application from start to finish by taking advantage of only JavaScript, HTML pages, and Windows Communication Foundation (WCF) services. Also learn about new ASP.NET AJAX features including the DataView control, declarative templates, live client-side data binding, WCF, and REST integration. &lt;/p&gt;      &lt;p /&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The conference has sold out, but you can register for the wait list:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/europe/TechEd/"&gt;http://www.microsoft.com/europe/TechEd/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/SpeakingatTechEdEuropeNextWeek_65EE/clip_image001_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/SpeakingatTechEdEuropeNextWeek_65EE/clip_image001_thumb.jpg" width="554" height="416" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://stephenwalther.com/blog/aggbug/132.aspx" width="1" height="1" /&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/StephenWalther?a=j7TwrQ70FZE:9aypMhRqcS0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StephenWalther?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/StephenWalther/~4/j7TwrQ70FZE" height="1" width="1"/&gt;</description>
            <dc:creator>Stephen Walther</dc:creator>
            <guid isPermaLink="false">http://stephenwalther.com/blog/archive/2009/11/03/speaking-at-tech-ed-europe-next-week.aspx</guid>
            <pubDate>Tue, 03 Nov 2009 15:15:02 GMT</pubDate>
            <wfw:comment>http://stephenwalther.com/blog/comments/132.aspx</wfw:comment>
            <comments>http://stephenwalther.com/blog/archive/2009/11/03/speaking-at-tech-ed-europe-next-week.aspx#feedback</comments>
            <slash:comments>16</slash:comments>
            <wfw:commentRss>http://stephenwalther.com/blog/comments/commentRss/132.aspx</wfw:commentRss>
        <feedburner:origLink>http://stephenwalther.com/blog/archive/2009/11/03/speaking-at-tech-ed-europe-next-week.aspx</feedburner:origLink></item>
        <item>
            <title>The Microsoft Ajax Library and Visual Studio Beta 2</title>
            <category>AJAX</category>
            <category>ASP.NET</category>
            <category>JavaScript</category>
            <link>http://feedproxy.google.com/~r/StephenWalther/~3/VGMRiEudR6U/the-microsoft-ajax-library-and-visual-studio-beta-2.aspx</link>
            <description>&lt;p&gt;Visual Studio 2010 Beta 2 was released this week and one of the first things that I hope you notice is that it no longer contains the latest version of ASP.NET AJAX. What happened? Where did AJAX go?&lt;/p&gt;  &lt;p&gt;Just like &lt;i&gt;Sting&lt;/i&gt; and &lt;i&gt;The Police&lt;/i&gt;, just like &lt;i&gt;Phil Collins&lt;/i&gt; and &lt;i&gt;Genesis&lt;/i&gt;, just like &lt;i&gt;Greg Page&lt;/i&gt; and the &lt;i&gt;Wiggles&lt;/i&gt;, AJAX has gone out of band! We are starting a solo career. &lt;/p&gt;  &lt;h4&gt;A Name Change&lt;/h4&gt;  &lt;p&gt;First things first. In previous releases, our Ajax framework was named &lt;i&gt;ASP.NET AJAX&lt;/i&gt;. We now have changed the name of the framework to the &lt;i&gt;Microsoft Ajax Library&lt;/i&gt;. There are two reasons behind this name change.&lt;/p&gt;  &lt;p&gt;First, the members of the Ajax team got tired of explaining to everyone that our Ajax framework is not tied to the server-side ASP.NET framework. You can use the Microsoft Ajax Library with ASP.NET Web Forms, ASP.NET MVC, PHP, Ruby on RAILS, and even pure HTML applications. Our framework can be used as a client-only framework and having the word &lt;i&gt;ASP.NET&lt;/i&gt; in our name was confusing people.&lt;/p&gt;  &lt;p&gt;Second, it was time to start spelling the word &lt;i&gt;Ajax&lt;/i&gt; like everyone else. Notice that the name is the &lt;i&gt;Microsoft &lt;b&gt;Ajax&lt;/b&gt; Library&lt;/i&gt; and not the &lt;i&gt;Microsoft &lt;b&gt;AJAX&lt;/b&gt; library&lt;/i&gt;. Originally, Microsoft used upper case AJAX because AJAX originally was an acronym for Asynchronous JavaScript and XML. And, according to Strunk and Wagnell, acronyms should be all uppercase. However, Ajax is one of those words that have migrated from acronym status to “just a word” status.&lt;/p&gt;  &lt;p&gt;So whenever you hear one of your co-workers talk about ASP.NET AJAX, gently correct your co-worker and say “It is now called the&lt;i&gt; Microsoft Ajax Library&lt;/i&gt;.”&lt;/p&gt;  &lt;h4&gt;Why OOB?&lt;/h4&gt;  &lt;p&gt;But why move out-of-band (OOB)? The short answer is that we have had approximately 6 preview releases of the Microsoft Ajax Library over the last year. That’s a lot.&lt;/p&gt;  &lt;p&gt;We pride ourselves on being agile. Client-side technology evolves quickly. We want to be able to get a preview version of the Microsoft Ajax Library out to our customers, get feedback, and make changes to the library quickly. Shipping the Microsoft Ajax Library out-of-band keeps us agile and enables us to continue to ship new versions of the library even after ASP.NET 4 ships. &lt;/p&gt;  &lt;h4&gt;Showing Love for JavaScript Developers&lt;/h4&gt;  &lt;p&gt;One area in which we have received a lot of feedback is around making the Microsoft Ajax Library easier to use for developers who are comfortable with JavaScript. We also wanted to make it easy for jQuery developers to take advantage of the innovative features of the Microsoft Ajax Library.&lt;/p&gt;  &lt;p&gt;To achieve these goals, we’ve added the following features to the Microsoft Ajax Library (these features are included in the latest preview release that you can download right now):&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;A simplified imperative syntax – We wanted to make it brain-dead simple to create client-side Ajax controls when writing JavaScript.&lt;/li&gt;    &lt;li&gt;A client script loader – We wanted the Microsoft Ajax Library to load all of the scripts required by a component or control automatically.&lt;/li&gt;    &lt;li&gt;jQuery integration – We love the jQuery selector syntax. We wanted to make it easy for jQuery developers to use the Microsoft Ajax Library without changing their programming style.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;If you are interested in learning about these new features of the Microsoft Ajax Library, I recommend that you read the following blog post by Scott Guthrie:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2009/10/15/announcing-microsoft-ajax-library-preview-6-and-the-microsoft-ajax-minifier.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2009/10/15/announcing-microsoft-ajax-library-preview-6-and-the-microsoft-ajax-minifier.aspx&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h4&gt;Downloading the Latest Version of the Microsoft Ajax Library&lt;/h4&gt;  &lt;p&gt;Currently, the best place to download the latest version of the Microsoft Ajax Library is directly from the ASP.NET CodePlex project:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://aspnet.codeplex.com/"&gt;http://aspnet.codeplex.com/&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;As I write this, the current version is Preview 6. The next version is coming out at the PDC.&lt;/p&gt;  &lt;h4&gt;Summary&lt;/h4&gt;  &lt;p&gt;I’m really excited about the future of the Microsoft Ajax Library. Moving outside of the ASP.NET framework provides us the flexibility to remain agile and continue to innovate aggressively. The latest preview release of the Microsoft Ajax Library includes several major new features including a client script loader, jQuery integration, and a simplified client control creation syntax.&lt;/p&gt;&lt;img src="http://stephenwalther.com/blog/aggbug/131.aspx" width="1" height="1" /&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/StephenWalther?a=VGMRiEudR6U:BdZ1vu8PwNI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StephenWalther?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/StephenWalther/~4/VGMRiEudR6U" height="1" width="1"/&gt;</description>
            <dc:creator>Stephen Walther</dc:creator>
            <guid isPermaLink="false">http://stephenwalther.com/blog/archive/2009/10/21/the-microsoft-ajax-library-and-visual-studio-beta-2.aspx</guid>
            <pubDate>Wed, 21 Oct 2009 16:21:39 GMT</pubDate>
            <wfw:comment>http://stephenwalther.com/blog/comments/131.aspx</wfw:comment>
            <comments>http://stephenwalther.com/blog/archive/2009/10/21/the-microsoft-ajax-library-and-visual-studio-beta-2.aspx#feedback</comments>
            <slash:comments>36</slash:comments>
            <wfw:commentRss>http://stephenwalther.com/blog/comments/commentRss/131.aspx</wfw:commentRss>
        <feedburner:origLink>http://stephenwalther.com/blog/archive/2009/10/21/the-microsoft-ajax-library-and-visual-studio-beta-2.aspx</feedburner:origLink></item>
        <item>
            <title>Using the New Microsoft Ajax Minifier</title>
            <category>ASP.NET</category>
            <category>JavaScript</category>
            <category>AJAX</category>
            <link>http://feedproxy.google.com/~r/StephenWalther/~3/sXvwEA4GnLE/using-the-new-microsoft-ajax-minifier.aspx</link>
            <description>&lt;p&gt;Last night, Scott Guthrie announced that the ASP.net team published a free tool that enables you to improve the performance of your Ajax applications by reducing the size of its JavaScript files. The new tool is named the Microsoft Ajax Minifier.&lt;/p&gt;
&lt;p&gt;You can read Scott Guthrie’s announcement here:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2009/10/15/announcing-microsoft-ajax-library-preview-6-and-the-microsoft-ajax-minifier.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2009/10/15/announcing-microsoft-ajax-library-preview-6-and-the-microsoft-ajax-minifier.aspx&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And you can download and install the free tool from the CodePlex website here:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=34488"&gt;http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=34488&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In this blog entry, I explain how you can take advantage of the Microsoft Ajax from the command-line and when you are using Visual Studio.&lt;/p&gt;
&lt;h4&gt;Overview of the Microsoft Ajax Minifier&lt;/h4&gt;
&lt;p&gt;The Microsoft Ajax Minifier was created by Ron Logan (who is clearly a super-genius). The Microsoft Ajax team (I work on this team) has been using this tool internally for a number of years. For example, we use the Microsoft Ajax Minifier to minify the Microsoft Ajax Library before publishing it.&lt;/p&gt;
&lt;p&gt;The Microsoft Ajax Minifier enables you to reduce the size of a JavaScript file by removing unnecessary content from the JavaScript file. The tool supports two modes: normal crunching and hypercrunching.&lt;/p&gt;
&lt;p&gt;When you use normal crunching, the Microsoft Ajax Minifier strips all comments, unnecessary whitespace, curly-braces, and semicolons from a JavaScript file. Surprisingly, just removing all of this unnecessary code fluff can make a significant difference to the size of a JavaScript file.&lt;/p&gt;
&lt;p&gt;When you use hypercrunching, the Microsoft Ajax Minifer gets more aggressive about reducing the size of a JavaScript file. In hpercrunching mode, the Microsoft Ajax Minifier shortens the names of local variables (variables in functions but not global variables) and it removes unreachable code.&lt;/p&gt;
&lt;p&gt;For example, here’s an unminified JavaScript file:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;// Adds two numbers&lt;/p&gt;
&lt;p&gt;function addNumbers(firstNumber, secondNumber, thirdNumber)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;var result = firstNumber + secondNumber + thirdNumber;&lt;/p&gt;
&lt;p&gt;return result;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;// Calculate cost&lt;/p&gt;
&lt;p&gt;var cost = addNumbers(1, 2, 3);&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And here is the same JavaScript file after it has been hypercrunched using the Microsoft Ajax Minifier:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;function addNumbers(b,a,c){var d=b+a+c;return d}var cost=addNumbers(1,2,3)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It is important not to confuse minifying with compressing. Both approaches to reducing the size of a JavaScript file are important. You can configure IIS to compress JavaScript files using GZIP compression automatically. You get additional performance benefits from minifying JavaScript files before compressing them.&lt;/p&gt;
&lt;h4&gt;Using the Microsoft Ajax Minifier from the Command-Line&lt;/h4&gt;
&lt;p&gt;When you install the Microsoft Ajax Minifier, you get a convenient &lt;strong&gt;Microsoft Ajax Minifier Command Prompt&lt;/strong&gt; that you can invoke from Start, Microsoft Ajax Minifier program group.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/UsingtheNewMicrosoftAjaxMinifier_BCB1/clip_image002_2.jpg"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="clip_image002" border="0" alt="clip_image002" width="509" height="259" src="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/UsingtheNewMicrosoftAjaxMinifier_BCB1/clip_image002_thumb.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This command prompt adds the Microsoft Ajax Minifier to the path variable so that you can change directories and still run the Microsoft Ajax Minifier.&lt;/p&gt;
&lt;p&gt;Use the following command to perform normal crunching:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;ajaxmin inputfile.js –o outputfile.js&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Use the following command to perform hypercrunching:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;ajaxmin –hc inputfile.js –o outputfile.js&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The Microsoft Ajax Minifier has a number of different switches that you can use to control how a file gets minified. These options are documented in the Microsoft Ajax Minifier documentation included in the Microsoft Ajax Minifier program group.&lt;/p&gt;
&lt;h4&gt;Using the Microsoft Ajax Minifier as a Visual Studio Build Task&lt;/h4&gt;
&lt;p&gt;You also can integrate the Microsoft Ajax Minifier directly into the Visual Studio build process. In that case, every time you perform a build, you can minifying all of the JavaScript files in your project automatically.&lt;/p&gt;
&lt;p&gt;When you install the Microsoft Ajax Minifier, a new MSBuild task named ajaxmin is added to the following folder:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;Program Files\MSBuild\Microsoft\MicrosoftAjax&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In order to use this custom build task in a Visual Studio Project, you need to modify the project file. You can modify a project file by opening the project file in Notepad. Just open Notepad and browse to your project folder and open the projectname.csproj or projectname.vbproj file.&lt;/p&gt;
&lt;p&gt;Alternatively, you can modify your project file directly within Visual Studio by right-clicking your project name in the Solution Explorer window and selecting the menu option &lt;strong&gt;Unload Project&lt;/strong&gt;. Next, you need to select the menu option &lt;strong&gt;Edit &lt;em&gt;Project Name&lt;/em&gt;&lt;/strong&gt; (see the following screenshots).&lt;/p&gt;
&lt;p&gt;&lt;a href="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/UsingtheNewMicrosoftAjaxMinifier_BCB1/clip_image004_2.jpg"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="clip_image004" border="0" alt="clip_image004" width="245" height="484" src="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/UsingtheNewMicrosoftAjaxMinifier_BCB1/clip_image004_thumb.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/UsingtheNewMicrosoftAjaxMinifier_BCB1/clip_image006_2.jpg"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="clip_image006" border="0" alt="clip_image006" width="244" height="148" src="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/UsingtheNewMicrosoftAjaxMinifier_BCB1/clip_image006_thumb.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I admit that, even though I work on the ASP.NET team, I had never noticed the &lt;em&gt;Unload Project&lt;/em&gt;, or&lt;em&gt; Edit Project Name&lt;/em&gt; menus before. A good day is a day when you can discover a super obscure Visual Studio menu item!&lt;/p&gt;
&lt;p&gt;After you open your project file using Notepad or Visual Studio, you need to add the following section anywhere within the project file (within the opening and closing &amp;lt;project&amp;gt; elements):&lt;/p&gt;
&lt;pre class="xml:nocontrols" name="code"&gt;&amp;lt;Import Project="$(MSBuildExtensionsPath)\Microsoft\MicrosoftAjax\ajaxmin.tasks" /&amp;gt;

&amp;lt;Target Name="AfterBuild"&amp;gt;

&amp;lt;ItemGroup&amp;gt;

&amp;lt;JS Include="**\*.js" Exclude="**\*.min.js;Scripts\*.js" /&amp;gt;

&amp;lt;/ItemGroup&amp;gt;

&amp;lt;AjaxMin SourceFiles="@(JS)" SourceExtensionPattern="\.js$" TargetExtension=".min.js" /&amp;gt;

&amp;lt;/Target&amp;gt;&lt;/pre&gt;
&lt;p&gt;This section imports the AjaxMin task. It causes the task to be executed after a build. The &amp;lt;ItemGroup&amp;gt; element is used to specify the set of files to minify. In this case, all files ending in the extension .js, but not files ending in the extension .min.js are selected for minification. All the files from the Scripts folder are also excluded (So jQuery and MicrosoftAjax won’t get re-minified). Finally, the files are actually minified by invoking the task with the &amp;lt;AjaxMin&amp;gt; element.&lt;/p&gt;
&lt;p&gt;After you make these changes, you can reload your Visual Studio project by right-clicking your project in the Solution Explorer window and selecting the&lt;strong&gt;&lt;em&gt; Reload Project&lt;/em&gt;&lt;/strong&gt; menu option.&lt;/p&gt;
&lt;p&gt;Because we added a custom task to our project -- and a custom task could do evil things like delete your entire hard drive -- you get the following warning dialog: &lt;/p&gt;
&lt;p&gt;&lt;a href="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/UsingtheNewMicrosoftAjaxMinifier_BCB1/clip_image008_2.jpg"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="clip_image008" border="0" alt="clip_image008" width="337" height="237" src="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/UsingtheNewMicrosoftAjaxMinifier_BCB1/clip_image008_thumb.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Select &lt;strong&gt;&lt;em&gt;Load project normally&lt;/em&gt;&lt;/strong&gt; and your project will appear in the Solution Explorer window again.&lt;/p&gt;
&lt;p&gt;Now here is the fun part. Now, that we have added the Microsoft Ajax Minifier task to our project file, every JavaScript file will get minified every time we perform a build. Just select the &lt;strong&gt;Build, Build Solution&lt;/strong&gt; or &lt;strong&gt;Build, Build Project&lt;/strong&gt; to perform the minification (or hit F5). &lt;/p&gt;
&lt;p&gt;Be aware that minified files are not added to a project automatically after a build. After performing a build, select the menu option &lt;strong&gt;Project, Show All Files&lt;/strong&gt; to see the new minified files.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/UsingtheNewMicrosoftAjaxMinifier_BCB1/clip_image010_2.jpg"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="clip_image010" border="0" alt="clip_image010" width="404" height="413" src="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/UsingtheNewMicrosoftAjaxMinifier_BCB1/clip_image010_thumb.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;The Microsoft Ajax Minifier makes it much easier to build high-performance Ajax applications. By reducing the size of your JavaScript files, you can enable the visitors to your website to download your Ajax applications much faster.&lt;/p&gt;&lt;img src="http://stephenwalther.com/blog/aggbug/130.aspx" width="1" height="1" /&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/StephenWalther?a=sXvwEA4GnLE:KMMjS99J7WQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StephenWalther?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/StephenWalther/~4/sXvwEA4GnLE" height="1" width="1"/&gt;</description>
            <dc:creator>Stephen Walther</dc:creator>
            <guid isPermaLink="false">http://stephenwalther.com/blog/archive/2009/10/16/using-the-new-microsoft-ajax-minifier.aspx</guid>
            <pubDate>Fri, 16 Oct 2009 20:25:13 GMT</pubDate>
            <comments>http://stephenwalther.com/blog/archive/2009/10/16/using-the-new-microsoft-ajax-minifier.aspx#feedback</comments>
            <slash:comments>31</slash:comments>
            <wfw:commentRss>http://stephenwalther.com/blog/comments/commentRss/130.aspx</wfw:commentRss>
        <feedburner:origLink>http://stephenwalther.com/blog/archive/2009/10/16/using-the-new-microsoft-ajax-minifier.aspx</feedburner:origLink></item>
        <item>
            <title>New AJAX Control Toolkit Release</title>
            <category>ASP.NET</category>
            <category>AJAX</category>
            <category>JavaScript</category>
            <link>http://feedproxy.google.com/~r/StephenWalther/~3/xIvQs4wpBEU/new-ajax-control-toolkit-release.aspx</link>
            <description>&lt;p&gt;We just released a new version of the AJAX Control Toolkit today. This new version includes significant bug fixes and two new controls. You can download the latest version – the September 30&lt;sup&gt;th&lt;/sup&gt; release – from the CodePlex website right here:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33804"&gt;http://ajaxcontroltoolkit.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33804&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Read the following tutorial to learn how to install the AJAX Control Toolkit:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://www.asp.net/learn/Ajax-Control-Toolkit/tutorial-47-cs.aspx"&gt;http://www.asp.net/learn/Ajax-Control-Toolkit/tutorial-47-cs.aspx&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In this blog entry, I provide a brief walkthrough of the two new controls included with this release and list the new bug fixes.&lt;/p&gt;
&lt;h4&gt;Seadragon Control&lt;/h4&gt;
&lt;p&gt;The Seadragon control enables you to pan, zoom, and make an image full screen. The control performs all of these fancy image effects using pure JavaScript and it works with any modern web browser.&lt;/p&gt;
&lt;p&gt;You can try out Seadragon by visiting the following web page. Click on the image of the bicycle that appears half-way down the page. &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a title="http://livelabs.com/seadragon-ajax/" href="http://livelabs.com/seadragon-ajax/"&gt;http://livelabs.com/seadragon-ajax/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The Seadragon control displays a menu of buttons:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/NewAJAXControlToolkitRelease_7AF0/clip_image002_2.jpg"&gt;&lt;img title="clip_image002" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="41" alt="clip_image002" width="148" border="0" src="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/NewAJAXControlToolkitRelease_7AF0/clip_image002_thumb.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When you click the plus + or minus – buttons, you zoom in and out of the image. When you click the home button you reset the zoom state. Finally, when you click the final button, the image becomes full screen (or more accurately, full browser window).&lt;/p&gt;
&lt;p&gt;You can also use your mouse to drag the image from side to side – you can stitch lots of images together to create a truly humongous image that you can drag through. And, if you click the image, you zoom in on the image.&lt;/p&gt;
&lt;p&gt;This control is super useful for displaying interactive pictures of products. For example, a customer can zoom in and zoom out of a picture of a shiny new laptop. A customer can use Seadragon to easily make the picture full screen.&lt;/p&gt;
&lt;p&gt;In order to use the Seadragon control, you need to (1) Create the image (2) Add the Seadragon control to a page. James Senior has created a great video quick start that demonstrates how you can use the Seadragon control for the Channel9 website: &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://channel9.msdn.com/posts/jsenior/Seadragon-Ajax-Control-Quick-Start-Guide/"&gt;http://channel9.msdn.com/posts/jsenior/Seadragon-Ajax-Control-Quick-Start-Guide/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In the following section, I provide a brief written tutorial that explains how you use the control.&lt;/p&gt;
&lt;h3&gt;Creating an Image with Deep Zoom Composer&lt;/h3&gt;
&lt;p&gt;Before you can display an image with the Seadragon control, you must first process the image with a tool named the Deep Zoom Composer. Luckily, Microsoft makes this tool available for free. You can download it from the following address:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=457b17b7-52bf-4bda-87a3-fa8a4673f8bf&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=457b17b7-52bf-4bda-87a3-fa8a4673f8bf&amp;amp;displaylang=en&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;After you install Deep Zoom Composer, you can convert an image into a format that is compatible with the Seadragon control. When you launch Composer, the following dialog appears:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/NewAJAXControlToolkitRelease_7AF0/clip_image004_2.jpg"&gt;&lt;img title="clip_image004" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="483" alt="clip_image004" width="341" border="0" src="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/NewAJAXControlToolkitRelease_7AF0/clip_image004_thumb.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Click the New Project button and call your new project anything that you like.&lt;/p&gt;
&lt;p&gt;After you create your project, Deep Zoom Composer displays the following three tabs at the top of the screen:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/NewAJAXControlToolkitRelease_7AF0/clip_image006_2.jpg"&gt;&lt;img title="clip_image006" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="57" alt="clip_image006" width="381" border="0" src="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/NewAJAXControlToolkitRelease_7AF0/clip_image006_thumb.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In order to create a Seadragon compatible image, you need to import the image, compose the image, and export the image. &lt;/p&gt;
&lt;p&gt;You import an image by clicking the Import tab (selected by default) and clicking the Add Image button that appears on the right of the screen. You can import images in standard formats such as PNG and JPEG. I used the Penguins.jpg sample picture included with Windows.&lt;/p&gt;
&lt;p&gt;Next, you need to compose your image. If you don’t complete this step then you end up with an empty image and nothing works.&lt;/p&gt;
&lt;p&gt;Click on the Compose tab and you will see the following screen:&lt;/p&gt;
&lt;p&gt;The picture that you imported appears at the bottom of the screen. You need to drag that picture into the main window area.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/NewAJAXControlToolkitRelease_7AF0/clip_image008_2.jpg"&gt;&lt;img title="clip_image008" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="472" alt="clip_image008" width="628" border="0" src="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/NewAJAXControlToolkitRelease_7AF0/clip_image008_thumb.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The final step is to export the image. Click the Export tab, click Custom, and select &lt;strong&gt;Images&lt;/strong&gt; as the Output Type and give your processed set of files a name (I named mine Penguins). Click the Export button to generate the files.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/NewAJAXControlToolkitRelease_7AF0/image_2.png"&gt;&lt;img title="image" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="633" alt="image" width="473" border="0" src="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/NewAJAXControlToolkitRelease_7AF0/image_thumb.png" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;After the files have been generated, you can click the &lt;strong&gt;View Image Folder&lt;/strong&gt; button to see the generated files. You also can click the &lt;strong&gt;Preview in Browser&lt;/strong&gt; button to get a preview of the image when displayed with Seadragon.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/NewAJAXControlToolkitRelease_7AF0/clip_image012_2.jpg"&gt;&lt;img title="clip_image012" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="316" alt="clip_image012" width="611" border="0" src="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/NewAJAXControlToolkitRelease_7AF0/clip_image012_thumb.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When you click the View Image Folder button, you will see the processed files. In particular, you should see a file named dzc_output.xml. Copy the entire folder to your Visual Studio/Visual Web Developer project folder.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/NewAJAXControlToolkitRelease_7AF0/image_4.png"&gt;&lt;img title="image" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="204" alt="image" width="708" border="0" src="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/NewAJAXControlToolkitRelease_7AF0/image_thumb_1.png" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;The last step – and the easiest step – is to create an ASP.NET page that uses the Seadragon control. The following page contains an instance of the Seadragon control that displays the image of the Penguins. &lt;/p&gt;
&lt;pre class="xml:nocontrols" name="code"&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestSeadragon._Default" %&amp;gt;

&amp;lt;%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %&amp;gt;

&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;

&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" &amp;gt;

&amp;lt;head runat="server"&amp;gt;

&amp;lt;title&amp;gt;Seadragon Demo&amp;lt;/title&amp;gt;

&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;

&amp;lt;form id="form1" runat="server"&amp;gt;

&amp;lt;div&amp;gt;

&amp;lt;cc1:ToolkitScriptManager ID="ScriptManager1" runat="server"/&amp;gt;

&amp;lt;cc1:Seadragon

ID="Seadragon1"

SourceUrl="Penguins/dzc_output.xml"

runat="server"&amp;gt;

&amp;lt;/cc1:Seadragon&amp;gt;

&amp;lt;/div&amp;gt;

&amp;lt;/form&amp;gt;

&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/pre&gt;
&lt;p&gt;There are two things that you should notice about this page. First, notice that the page includes a ToolkitScriptManager control. You must include either a ToolkitScriptManager control or a ScriptManager control when using controls from the AJAX Control Toolkit such as the Seadragon control.&lt;/p&gt;
&lt;p&gt;Second, notice that the Seadragon SourceUrl property points to the dzc_output.xml file. This XML file describes the image of the Penguins that the Seadragon control displays.&lt;/p&gt;
&lt;h3&gt;AsynFileUpload Control&lt;/h3&gt;
&lt;p&gt;The second new control included in the newest release of the AJAX Control Toolkit is the AsyncFileUpload control. You can use this control to display a fancier interface for uploading files. The AsyncFileUpload control:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Enables you to perform file uploads without doing a postback &lt;/li&gt;
    &lt;li&gt;Displays a throbber images while an image is being uploaded &lt;/li&gt;
    &lt;li&gt;Raises both server and client events when a file upload completes or when there is an error. &lt;/li&gt;
    &lt;li&gt;Works inside and outside of an UpdatePanel &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Admit it! The standard file upload widget that you get with HTML is boring. You can’t display a picture while a file is uploading. And, it forces you to do a postback which is bad in this new Ajax world.&lt;/p&gt;
&lt;p&gt;Here’s a simple example of how you use the AsyncFileUpload control in an ASP.NET page:&lt;/p&gt;
&lt;pre class="xml:nocontrols" name="code"&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestAsnycFileUpload.aspx.cs" Inherits="TestSeadragon.TestAsnycFileUpload" %&amp;gt;

&amp;lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %&amp;gt;

&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;

&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" &amp;gt;

&amp;lt;head runat="server"&amp;gt;

&amp;lt;title&amp;gt;AsyncFileUpload Demo&amp;lt;/title&amp;gt;

&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;

&amp;lt;form id="form1" runat="server"&amp;gt;

&amp;lt;div&amp;gt;

&amp;lt;asp:ScriptManager ID="sm1" runat="server" /&amp;gt;

&amp;lt;asp:UpdatePanel ID="up1" runat="server"&amp;gt;

&amp;lt;ContentTemplate&amp;gt;

&amp;lt;h1&amp;gt;Add File&amp;lt;/h1&amp;gt;

File: &amp;lt;br /&amp;gt;

&amp;lt;cc1:AsyncFileUpload

ID="AsyncFileUpload1"

onuploadedcomplete="AsyncFileUpload1_UploadedComplete"

runat="server" /&amp;gt;

&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;

Description:&amp;lt;br /&amp;gt;

&amp;lt;asp:TextBox ID="txtDescription" runat="server" /&amp;gt;

&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;

&amp;lt;asp:Button ID="btnSubmit" Text="Add File" runat="server" /&amp;gt;

&amp;lt;/ContentTemplate&amp;gt;

&amp;lt;/asp:UpdatePanel&amp;gt;

&amp;lt;/div&amp;gt;

&amp;lt;/form&amp;gt;

&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/pre&gt;
&lt;p&gt;Notice that the AsyncFileUpload control is included in an UpdatePanel. You aren’t required to include the control in an UpdatePanel. However, unlike the standard ASP.NET FileUpload, you &lt;em&gt;can&lt;/em&gt; place the AsyncFileUpload control in an UpdatePanel.&lt;/p&gt;
&lt;p&gt;The AsyncFileUpload control includes an event handler for the server-side UploadComplete event. You can handle this event to save the uploaded file:&lt;/p&gt;
&lt;pre class="c#:nocontrols" name="code"&gt;using System.IO;

namespace TestSeadragon

{

public partial class TestAsnycFileUpload : System.Web.UI.Page

{

protected void AsyncFileUpload1_UploadedComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)

{

System.Threading.Thread.Sleep(5000);

string savePath = MapPath("~/Uploads/") + Path.GetFileName(e.filename);

AsyncFileUpload1.SaveAs(savePath);

}

}

}&lt;/pre&gt;
&lt;p&gt;In order for this code to work, ASP.NET needs permissions to write to the Uploads folder on the file system. Typically, you need to add write permissions for either the NT Authority\Network Service account or the MACHINE\ASPNET account (in the case of IIS 5).&lt;/p&gt;
&lt;p&gt;After you select a file, and the file is successfully uploaded, the background color of the AsyncFileUpload control turns green:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/NewAJAXControlToolkitRelease_7AF0/clip_image016_2.jpg"&gt;&lt;img title="clip_image016" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="405" alt="clip_image016" width="415" border="0" src="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/NewAJAXControlToolkitRelease_7AF0/clip_image016_thumb.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you want to get fancier then you can display a “throbber” image while the file is being uploaded. I like to use a website named AjaxLoad.info – located at &lt;a href="http://AjaxLoad.info"&gt;http://AjaxLoad.info&lt;/a&gt; -- to create my progress images. This website enables you to generate the standard rotating circle progress indicator as well as fancier progress indicators such as a bouncing ball.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/NewAJAXControlToolkitRelease_7AF0/clip_image018_2.jpg"&gt;&lt;img title="clip_image018" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="596" alt="clip_image018" width="552" border="0" src="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/NewAJAXControlToolkitRelease_7AF0/clip_image018_thumb.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I picked Circle Ball and saved the image to my project with the name ajax-loader.gif.&lt;/p&gt;
&lt;p&gt;After you create a throbber image, you can add the image to your page and associate the image with the AsyncFileUpload by taking advantage of the ThrobberID property like this:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre class="xml:nocontrols" name="code"&gt;File: 

&amp;lt;asp:Label ID="throbber" style="display:none" runat="server"&amp;gt;

&amp;lt;img align="absmiddle" alt="loading" src="ajax-loader.gif" /&amp;gt;

&amp;lt;/asp:Label&amp;gt;

&amp;lt;br /&amp;gt;

&amp;lt;cc1:AsyncFileUpload

ID="AsyncFileUpload1"

ThrobberID="throbber"

onuploadedcomplete="AsyncFileUpload1_UploadedComplete"

runat="server" /&amp;gt;&lt;/pre&gt;
&lt;p&gt;Notice that ThrobberID points to a Label control that contains the image (and the Label is hidden with display:none). During a file upload, the image is displayed.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/NewAJAXControlToolkitRelease_7AF0/clip_image020_2.jpg"&gt;&lt;img title="clip_image020" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="204" alt="clip_image020" width="628" border="0" src="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/NewAJAXControlToolkitRelease_7AF0/clip_image020_thumb.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;AJAX Control Toolkit Bug Fixes&lt;/h3&gt;
&lt;p&gt;With each release of the AJAX Control Toolkit, we look at the top voted bugs associated with the AJAX Control Toolkit at the CodePlex website and fix them. In other words, we take your feedback on bugs from the CodePlex website very seriously. If you notice an issue with the AJAX Control Toolkit, please do report the issue:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/List.aspx"&gt;http://ajaxcontroltoolkit.codeplex.com/WorkItem/List.aspx&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;With this release of the AJAX Control Toolkit, we performed over 20 bug fixes.&lt;/p&gt;
&lt;p&gt;One of the major bug fixes addresses an issue with positioning when using Internet Explorer 8. In the previous release, when you opened a Calendar or ColorPicker control by clicking in a text field, the position of the Calendar or ColorPicker that popped up could be slightly off. All of these popup positioning issues should be fixed in the current release.&lt;/p&gt;
&lt;p&gt;We also made several substantial bug fixes to the Calendar, Tabs, and CollapsiblePanel controls. Here is a complete list of bug fixes (including links to the corresponding CodePlex issue for more details): &lt;/p&gt;
&lt;table cellspacing="0" cellpadding="10"&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;Bug Number&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;Description&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="106"&gt;
            &lt;p&gt;Control&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;8843&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=8843"&gt;Support wrapping tab headers to prevent horizontal scrolling if there are too many tabs&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;Tabs&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;1514&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=1514"&gt;CollapsiblePanel doesn't completely collapse when the target has padding or other styles&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;CollapsiblePanel&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;9171&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=9171"&gt;Disable TabPanel (not hiding)&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;Tabs&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;5335&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=5335"&gt;Accessibility: Slider: Add keyboard support for slider&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;Slider&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;9601&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=9601"&gt;Change default view of Calendar&lt;/a&gt;&lt;strong&gt;&lt;em&gt; &lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;Calendar&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;12957&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=12957"&gt;Calendar control clears time value&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;Calendar&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;9365&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=9365"&gt;Calendar Extender Is Cut Off&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;Calendar&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;7857&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=7857"&gt;Calendar Extender Inside GridView or DetailsView&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;Calendar&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;9332&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=9332"&gt;Calendar: today's date and title localization&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;Calendar&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;14845&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=14845"&gt;ScriptObjectBuilder.DescribeComponent performance&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;Calendar&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;11238&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=11238"&gt;TABS: Problem using CSSClass&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;Tabs&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;12206&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=12206"&gt;Strange CalendarExtender Behavior...code/sample link provided.&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;Calendar&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;14639&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=14639"&gt;CollapsiblePanelExtender flashes in UpdatePanel for Framework v3.5&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;CollapsiblePanel&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;10161&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=10161"&gt;Accordian Panel, Dynamically created buttons, CommandEventHandler hookup on Command doesn't work&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;Accordion&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;11129&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=11129"&gt;TabIndex and TabPanel Visible Property&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;Tabs&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;11446&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=11446"&gt;Tab Control Not Data Binding inside of FormView&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;Tabs&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;16321&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=16321"&gt;TabPanel Visible=false causes other tab panels to show mixed content when setting ActiveTabIndex&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;Tabs&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;9099&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=9099"&gt;Calendar on scrollable page, position not set by textbox position&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;Calendar&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;12147&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=12147"&gt;positioning problem when in a relative div&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;Calendar&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;9242&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=9242"&gt;Calendar Days Not Shown&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;Calendar&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;10703&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=10703"&gt;TabContainer inside UpdatePanel&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;Tabs&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="103"&gt;
            &lt;p&gt;15658&lt;/p&gt;
            &lt;/td&gt;
            &lt;td width="272"&gt;
            &lt;p&gt;&lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=15658"&gt;TabContainer: Specified argument was out of the range of values #2&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
            &lt;td valign="top" width="106"&gt;
            &lt;p&gt;Tabs&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;A big thanks to Obout consulting – &lt;a href="http://obout.com"&gt;http://obout.com&lt;/a&gt; – for making these bug fixes.&lt;/p&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;p&gt;With each release of the AJAX Control Toolkit, we add new controls and improve the quality of the existing controls. Stay tuned! We have major plans for the AJAX Control Toolkit in the coming months.&lt;/p&gt;&lt;img src="http://stephenwalther.com/blog/aggbug/129.aspx" width="1" height="1" /&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/StephenWalther?a=xIvQs4wpBEU:pucN-G2dwsU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StephenWalther?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/StephenWalther/~4/xIvQs4wpBEU" height="1" width="1"/&gt;</description>
            <dc:creator>Stephen Walther</dc:creator>
            <guid isPermaLink="false">http://stephenwalther.com/blog/archive/2009/10/01/new-ajax-control-toolkit-release.aspx</guid>
            <pubDate>Thu, 01 Oct 2009 15:44:44 GMT</pubDate>
            <comments>http://stephenwalther.com/blog/archive/2009/10/01/new-ajax-control-toolkit-release.aspx#feedback</comments>
            <slash:comments>18</slash:comments>
            <wfw:commentRss>http://stephenwalther.com/blog/comments/commentRss/129.aspx</wfw:commentRss>
        <feedburner:origLink>http://stephenwalther.com/blog/archive/2009/10/01/new-ajax-control-toolkit-release.aspx</feedburner:origLink></item>
        <item>
            <title>Microsoft Ajax CDN and the jQuery Validation Library</title>
            <category>AJAX</category>
            <category>ASP.NET</category>
            <category>ASP.NET MVC</category>
            <category>CDN</category>
            <link>http://feedproxy.google.com/~r/StephenWalther/~3/qmQzXR9fiFA/microsoft-ajax-cdn-and-the-jquery-validation-library.aspx</link>
            <description>&lt;p&gt;Scott Guthrie announced the launch of the Microsoft Ajax CDN on his blog last night. If you have not read his post, I recommend that you read it now to get a general overview of the CDN and how you can take advantage of the CDN to improve the performance of your ASP.NET Web Forms and ASP.NET MVC applications:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a title="http://weblogs.asp.net/scottgu/archive/2009/09/15/announcing-the-microsoft-ajax-cdn.aspx" href="http://weblogs.asp.net/scottgu/archive/2009/09/15/announcing-the-microsoft-ajax-cdn.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2009/09/15/announcing-the-microsoft-ajax-cdn.aspx&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In his announcement, Scott describes how both the ASP.NET Ajax and the jQuery libraries are included in the CDN. There is one more set of JavaScript files that we added to the CDN today that Scott did not announce: the jQuery Validation library.&lt;/p&gt;
&lt;p&gt;If you are not familiar with the jQuery Validation library then you should know that this is one of the most popular form validation libraries used by jQuery developers. We are shipping the jQuery validation library with both ASP.NET Web Forms and ASP.NET MVC when we ship Visual Studio 2010. &lt;/p&gt;
&lt;p&gt;Furthermore, we are integrating the jQuery Validation library with ASP.NET MVC. When you add an error to ModelState – for example, by using ModelState.AddModelError() – the error will float up to the client automatically. The jQuery Validation library is the JavaScript library used by ASP.NET MVC to implement client-side validation. &lt;/p&gt;
&lt;p&gt;I had the pleasure of meeting Jörn Zaefferer at the jQuery conference in Cambridge last weekend (You pronounce Jörn’s name like &lt;em&gt;Yearn&lt;/em&gt;). He has written a really great validation library and now you can use his validation library directly from the Microsoft Ajax CDN. &lt;/p&gt;
&lt;p&gt;Here are the URLs for the jQuery Validation library:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://ajax.microsoft.com/ajax/jquery.validate/1.5.5/jquery.validate.js"&gt;http://ajax.microsoft.com/ajax/jquery.validate/1.5.5/jquery.validate.js&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://ajax.microsoft.com/ajax/jquery.validate/1.5.5/jquery.validate.min.js"&gt;http://ajax.microsoft.com/ajax/jquery.validate/1.5.5/jquery.validate.min.js&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://ajax.microsoft.com/ajax/jquery.validate/1.5.5/jquery.validate-vsdoc.js"&gt;http://ajax.microsoft.com/ajax/jquery.validate/1.5.5/jquery.validate-vsdoc.js&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The first URL contains the unminified (human readable) version of the jQuery validation library. The second URL contains a minified version of the library that you should use in production applications. Finally, the third URL points to a JavaScript file that contains Intellisense comments for the jQuery validation library that is used by Visual Studio 2010 automatically.&lt;/p&gt;
&lt;p&gt;Here’s a simple Web Forms page that uses the jQuery Validation library to validate a Registration form (see Figure 1):  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Listing 1 – Registration Form&lt;/strong&gt;&lt;/p&gt;
&lt;pre class="xml:nocontrols" name="code"&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestjQueryValidation.aspx.cs" Inherits="WebApplication2.TestjQueryValidation" %&amp;gt;

&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;

&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" &amp;gt;
&amp;lt;head runat="server"&amp;gt;
    &amp;lt;title&amp;gt;Registration Form&amp;lt;/title&amp;gt;

    &amp;lt;script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.min.js" 
        type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src="http://ajax.microsoft.com/ajax/jquery.validate/1.5.5/jquery.validate.min.js" 
        type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;
    
    &amp;lt;style type="text/css"&amp;gt;
    
    input.error
    {
        background-color: #FFFF99;
    }
    
    &amp;lt;/style&amp;gt;
    
    &amp;lt;script type="text/javascript"&amp;gt;
      $(documentReady);
      
      function documentReady() 
      {
        $("#form1").validate();
      };
      
    &amp;lt;/script&amp;gt;

&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;form id="form1" runat="server"&amp;gt;
    &amp;lt;div&amp;gt;
    
    &amp;lt;h1&amp;gt;Register&amp;lt;/h1&amp;gt;
    
    &amp;lt;asp:Label 
        ID="lblName" 
        AssociatedControlID="txtName" 
        Text="Name:"
        runat="server" /&amp;gt;
    &amp;lt;asp:TextBox 
        ID="txtName" 
        CssClass="required" 
        runat="server" /&amp;gt;

    &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;
    
    &amp;lt;asp:Label 
        ID="lblEmail" 
        AssociatedControlID="txtEmail" 
        Text="Email:"
        runat="server" /&amp;gt;
    &amp;lt;asp:TextBox 
        ID="txtEmail" 
        CssClass="required email"
        runat="server" /&amp;gt;
    
    &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;
    
    &amp;lt;asp:Button 
        ID="btnSubmit" 
        Text="Register" 
        runat="server" /&amp;gt;
    
    &amp;lt;/div&amp;gt;
    &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Figure 1 – Create Movie form&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/MicrosoftAjaxCDNandthejQueryValidationLi_B935/image_2.png"&gt;&lt;img title="image" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="353" alt="image" width="570" border="0" src="http://stephenwalther.com/blog/images/stephenwalther_com/blog/WindowsLiveWriter/MicrosoftAjaxCDNandthejQueryValidationLi_B935/image_thumb.png" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The Registration form in Listing 1 contains two TextBox controls for a user name and email address. The jQuery Validation library is used to make both fields required and validate that a proper email address has been entered.  There are two things that you need to do to get the jQuery Validation library to work:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Call the validate() method on your form. Calling the validate() method sets up the client validation. &lt;/li&gt;
    &lt;li&gt;Add the right classes to the fields that you want to validate. In the case of Listing 1, I added a &lt;em&gt;required&lt;/em&gt; class to both the txtName and txtEmail TextBox controls and an &lt;em&gt;email&lt;/em&gt; class to the txtEmail TextBox control. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The jQuery Validation library supports a number of specialized validation classes including classes like &lt;em&gt;url&lt;/em&gt; and &lt;em&gt;creditcard&lt;/em&gt;: If you want to read the full documentation for the jQuery Validation library then you can visit the following website:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a title="http://docs.jquery.com/Plugins/Validation" href="http://docs.jquery.com/Plugins/Validation"&gt;http://docs.jquery.com/Plugins/Validation&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;img src="http://stephenwalther.com/blog/aggbug/128.aspx" width="1" height="1" /&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/StephenWalther?a=qmQzXR9fiFA:rAhVIaD_MHA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/StephenWalther?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/StephenWalther/~4/qmQzXR9fiFA" height="1" width="1"/&gt;</description>
            <dc:creator>Stephen Walther</dc:creator>
            <guid isPermaLink="false">http://stephenwalther.com/blog/archive/2009/09/16/microsoft-ajax-cdn-and-the-jquery-validation-library.aspx</guid>
            <pubDate>Wed, 16 Sep 2009 20:10:15 GMT</pubDate>
            <comments>http://stephenwalther.com/blog/archive/2009/09/16/microsoft-ajax-cdn-and-the-jquery-validation-library.aspx#feedback</comments>
            <slash:comments>17</slash:comments>
            <wfw:commentRss>http://stephenwalther.com/blog/comments/commentRss/128.aspx</wfw:commentRss>
        <feedburner:origLink>http://stephenwalther.com/blog/archive/2009/09/16/microsoft-ajax-cdn-and-the-jquery-validation-library.aspx</feedburner:origLink></item>
    </channel>
</rss>
