Friday, December 01, 2006


So at work we have these meetings once in a while where we discuss technology. Well it was my turn to lead a discussion and I thought AJAX would be a good topic.

At a past client, I used AJAX for a on the fly rate form. Basically how it worked was when a user filled in a field, the updated line item and grand total was to be updated without a full page post back. Well when I did this project ATLAS, now AJAX.ASP.NET was not ready, so I had to do it the old school way.

So first before I go further let me talk about what AJAX is. AJAX, stands for asynchronous JavaScript and XML. AJAX is a web development technique for creating interactive web applications. The intent is to make web pages feel more responsive by exchanging small amounts of data with the server behind the scenes, so that the entire web page does not have to be reloaded each time the user makes a change. This is meant to increase the web page's interactivity, speed, and usability.

Some pros of using AJAX is bandwidth usage, and interactivity. With smaller request to the server, smaller amounts of data or subsets are transmitted. Some cons, are latency and usability. When part of a web page is being updated, some controls can become unusable.

So now that you know a little more about AJAX in general lets talk geek....

Basicly the guts of it all revolves around an object called XMLHttpRequest. This object will make a request to a url and collect the response from the request. the url could be anything, but web services work well. Then you can take the response usually and XML and manipulate it and set controls on the web page.

Now I find this a challenge since I am not a big fan of JavaScript and Microsoft Visual Studio does not give you great support for JavaScript. However I was still able to provide a good solution for my client, and I saw benefits to this technique.

Now lets fast forward to today. The people at AJAX.ASP.NET have release a beta of an AJAX framework. This framework wraps up the JavaScript and all you have to do is the ASP. Any regular asp control can be enabled to post back asynchronously. Also they released a toolkit extension that gives you additional support.

During our discussion one of the areas we decided we could really use this is in field validation. Validation is tough because a lot of times you need to duplicate your validation logic in JavaScript for the client side validation and then in you BLL for server validation. Using AJAX you can now validate fields as the user fills them out and keep you validation code only in your BLL.

As you can see, AJAX is a very useful tool. With the help of AJAX.ASP.Net (Atlas) you can really improve on the user experience at any website you have to build.
Post a Comment