AJAX Options

AJAX is still a large buzz in the industry.  For some that are just beginning to use this technology, it can be confusing to know where to start.  There are dozens of choices of technologies that will allow you to create AJAX enabled systems, but which do you choose?  Which is the “right” one?

This post will explore some the options we’ve tried as well as the pros and cons of each.

Our experiences in developing web-based applications have not been limited to developing only ASP.NET applications.  We have run the gamut of development technologies though we have standardized on two technologies in particular in the recent number of years; ASP.NET and PHP.

We looked at a number of technologies to help us implement AJAX in our web applications. The first decent package was Anthem.NET.

Anthem has an extended set of ASP.NET controls that have AJAX built right into them. For example, if you want an ASP.NET Button on your form make the post-back call through
AJAX, you can simply reference the Anthem library and change your ASP.NET Button to an Anthem Button:

From:  <asp:button id=”someId” />
To:     <anthem:button id=”someId” />

And your call back to the server-side processing will be made through AJAX.  Very easy and Anthem has extended all common ASP.NET controls including the DataGrid, DataList and Calendar controls.  Also, Anthem handles both 1.1 and 2.0 versions of ASP.NET.

A draw back to Anthem.NET is that you cannot control the order of AJAX calls to the server.  For complicated forms, the asynchronous calls can be confused and fired out of order.  Anthem is a great solution for simple systems.

Next, we looked at a Microsoft initiative, code named Atlas at the time.  Atlas was in alpha testing and it we decided not to pursue it further until the project matured.  Atlas bloomed into its 1.0 release as ASP.NET AJAX, a much leaner and production ready toolset.  I can’t help but feel that ASP.NET AJAX is the proverbial elephant gun to allow us developers to hunt rabbit. It’s a large toolset that is difficult to retrofit into an existing web application as there are a number of elements that need to be added to the project’s web.config file.  On the plus side, once it is integrated with your web application, making use of AJAX calls is as simple as adding an <UpdatePanel> to your ASPX page. Don’t forget to also add that <ScriptManager> or your calls will fail and the server will complain.  An post back thrown inside the update panel is handled through AJAX.

ASP.NET AJAX may be large, and a bit of a challenge to implement, but it is a very powerful and thorough implementation of AJAX.  Coupled with the powerful ASP.NET AJAX Control Toolkit, we are deciding to use ASP.NET AJAX more often in our web applications.

As I said earlier, not all of our web applications are based on ASP.NET.  For these systems, we have standardized on using Prototype. Prototype is an amazing JavaScript library that can be easily added to any web page by simply referencing the prototype.js file.  Doing so exposes a number of client side javaScript enhancements including an AJAX model for executing AJAX requests and handling the response.  Prototype is so helpful, that we’ve also used it in a number of ASP.NET web applications for everything from client side UI handling, wiring client side events and process AJAX requests.

We have made tremendous inroads to finding meaningful ways of integrating Prototype with ASP.NET applications to create robust web applications that offer very rich user
experiences.