Other AJAX Libraries

Other AJAX Libraries

In addition to ASP.NET AJAX, many third-party AJAX libraries are available that can be used with ASP.NET, although not all of them were specifically designed for it. Some are mostly focused on providing JavaScript libraries for use from within the browser to make manipulation of the browser DOM (Document Object Model) easier. Others include some level of server functionality for use within ASP.NET pages (where server controls will render on the client side). This section briefly highlights some of what these libraries offer. The ASP.NET AJAX Framework can coexist with script and controls from other libraries, although given the dynamic nature of the JavaScript language, it is possible to extend types so that they conflict with each other. Mixing and matching libraries might work just fine for many uses, but you might find conflicts in other cases.

  • Ajax.NET Professional: Michael Schwartz developed Ajax.NET Professional as a tool primarily used to simplify the data transport mechanism that enables a client JavaScript routine to communicate with a server program. The server code is simple to use: You merely need to register the control in your page and decorate some code-behind methods with attributes to designate which ones can be called from the client. Then you can leverage the script library to make the calls and pass data. This is intended for developers who are well versed with DHTML, and there aren’t many prebuilt visual controls. This is a lightweight solution with very little overhead in terms of bytes transferred and processing cycles needed on the client and server. The source code is available, and the package is free (http://www.ajaxpro.info).

  • Anthem.NET: Anthem.NET is a SourceForge project where users are able to download the sources to the project. It targets ASP.NET 1.1 and ASP.NET 2.0. It has a set of server controls that use their underlying JavaScript library to communicate with the server. They provide the ability to access the state of controls on the page during an asynchronous callback. At the time of writing, the Anthem.NET web page (http://anthem-dot-net.sourceforge.net) points out that the Anthem.NET user needs to be an experienced ASP.NET developer to get the most out of it. However, this is generally easier to use than Ajax.NET Professional, especially for developers who aren’t well-versed in DHTML. This project is similar to ASP.NET Ajax in many ways but isn’t as comprehensive.

  • DoJo: The DoJo toolkit can be found at http://dojotoolkit.com. It is a client-side library for AJAX development without ties to any server technology. DoJo has a type system for JavaScript and a function for binding script to events from JavaScript objects or DHTML elements. One of its strengths is rich support for dynamic script loading. You can specify dependencies and ordering in the way that scripts are retrieved and processed.

  • Prototype: The Prototype script library is available at http://prototype.conio.net. It does not target any server technology for integration. It has a type system for scripting in a more object-oriented way, along with some shortcut syntaxes for dealing with JavaScript arrays as well as accessing and manipulating HTML elements on the page. Prototype provides networking functionality and a method for automatically updating an HTML element with the results of an HTTP request when given a URL. The Prototype library also has functions for associating script objects and methods with DOM objects and events. The library is focused on simplifying tasks that can be cumbersome and tedious. It doesn’t provide much help for producing a richer user interface but puts forth the building blocks for an improved web-scripting experience.

  • Script.aculo.us: The Script.aculo.us library can be found at the website of the same name: http://script.aculo.us. Their tagline is “it’s about the user interface, baby!” which accurately describes their focus. Script.aculo.us is built on top of the Prototype library and picks up where it stops. It includes functionality for adding drag-and-drop support to an application. It has a lot of effects code for fading, shrinking, moving, and otherwise animating DOM elements. Script.aculo.us also has a slider control and a library for manipulating lists of elements.

  • Rico: The Rico library also builds on top of the Prototype system. It has support for adding drag-and-drop behavior to browser DOM elements. It also has some controls to bind JavaScript objects to DOM elements for manipulating data. Rico has constructs for revealing and hiding portions of a page using an accordion style. It also has animation, sizing, and fading effects prebuilt for easier use. These UI helpers are available at http://openrico.org.