In addition to launching the AJAX CDN site, the ASP.NET team
has also recently released ASP.NET AJAX Preview 5. You can download ASP.NET
AJAX Preview 5 (with sample code) from CodePlex: http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=32770
You can also now use the ASP.NET AJAX libraries simply by
adding the following script tags that point at the CDN:
<script src="http://ajax.microsoft.com/ajax/beta/0909/MicrosoftAjax.js"
type="text/javascript"></script>
<script src="http://ajax.microsoft.com/ajax/beta/0909/MicrosoftAjaxTemplates.js"
type="text/javascript"></script>
These script tags reference the beta version of the
September 2009 release of the ASP.NET AJAX library (the /0909/ part of the URL
represents the year and month that the version of ASP.NET AJAX was
released).
After you add script tags that reference the ASP.NET AJAX
library, you can start using the library in your page. For example, the
following code attaches a client DataView control that represents an array of
photos to a DIV element in the body of the page.
The DIV element – with an id of "photos" –
contains a template for formatting each photo in the array of photos. Here’s
how the photos element is declared:
When the DataView is rendered, the contents of the photos
DIV element is rendered for each photo in the array of photos. The following
photos are displayed:
Because ASP.NET AJAX is a pure JavaScript library, the code
above works perfectly well in an ASP.NET Web Forms, ASP.NET MVC, HTML, or even
with classic Active Server Pages. The code also works with all modern browsers.
You can learn more about ASP.NET AJAX Preview 5 by
downloading the sample code from the CodePlex project: http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=32770
Below are several blog posts that delve into the features of
ASP.NET AJAX Preview 5 in more depth:
Microsoft Ajax 4 Preview 5: The DataView Control -- Dave
Reed explains how to take advantage of the new Dynamic Templates and
Placeholders feature added to Preview 5.
ASP.NET Ajax Preview 5 and UpdatePanel – Jim Wang explains
how you can use Preview 5 with existing websites that use the standard ASP.NET
UpdatePanel control.
Building a class browser with Microsoft Ajax 4.0 Preview 5
– Bertrand Le Roy builds a very cool Ajax class browser application by taking
advantage of several new features of Preview 5 including recursive templates.
How the DataContext can change your data and your life (well,
sort of, but not really) – Jonathan Carter has a great series of posts that
dive into the details of the Ajax DataView and DataContext.