There has been a lot of buzz around SharePoint support for ASP.NET AJAX the last couple of days, resulting in some nice posts, even from the Microsoft guys. If you are new to the topic; some required reading:
- Integrating ASP.NET AJAX with SharePoint (by Mike Ammerlaan)
Mike clearly described what you need to do to get the ASP.NET AJAX extensions working in a SharePoint site. First install the extensions (of course), then make some changes to the web.config of the SharePoint site.
- AjaxBasePart: Easy ASP.NET 2.0 AJAX Extensions 1.0 and Office SharePoint Server 2007 (by Eric Schoonover)
Eric describes how you can make use of ASP.NET AJAX in a SharePoint web part, he posts code for his implementation of a base web part class that supports AJAX. The nice thing about this base web part class is that it dynamically adds the AJAX ScriptManager control to the class (required for the AJAX stuff).
Yesterday evening (very late :-) ) I've created a version of the SmartPart that makes use of the Eric's technique, let me introduce you the SmartPart with AJAX! So basically said: you can create a Web User Control (ASCX) with the Visual Studio Designer, that uses the ASP.NET AJAX extensions and run that user control as a SharePoint web part. At this point in time, it's still a beta version, you can get it from the GotDotNet workspace (releases section). How do you get started? First of all you need to download and install the ASP.NET AJAX Extensions. Next you need to extend your SharePoint site with these extensions, check Mike's post for detailed instructions. You only need to change the web.config, you don't need to add the ScriptManager to the master page! Now you can install the SmartPart (check the Installation guide, or this screencast).
Now you can start building ASP.NET AJAX style user controls and use them in SharePoint! The beta version of the SmartPart ships with a couple of examples, but I've recorded a small screencast (no sound yet) as well, you just need to see AJAX in action, screenshots don't give you an idea about how the web parts behave without postbacks. Just watch the demos and see how easy it is! :-)
To finish of I would like to thank two persons who helped me with this release of the SmartPart. First of all Eric Schoonover for posting the code for his AjaxBasePart and for the support via Messenger. :-) Secondly I'd like to thank my friend and colleague Kevin DeRudder (still no blog?) who introduced me to the wonderful world of AJAX and helped me a lot with the demos.
Here's a screenshot of the Calendar control from the ASP.NET AJAX Control Toolkit, hosted in a SmartPart on a WSSv3 site: