Home > View Post

An introduction to the ASP.NET AJAX Extensions

AJAX Cleaning SolutionsI recently had to look at AJAX options for a client and spent some time getting familiar with the new ASP.NET AJAX Extensions RC. JavaScript and DHTML used to be my thing for a long time so this stuff has a special place in my heart.

Way back I developed my own version of cross-browser AJAX[1] that dynamically added a new script tag to the page with a src attribute that pointed to an .asp file, using the querystring to pass information to the server. The .asp file was then responsible for generating the appropriate script - it worked a treat and we had an AJAX-enabled TreeView in 2000[1]. Heady days. I think it was known as 'Remote Scripting' at the time...

Anyway, back to the plot. I've been looking at the ASP.NET AJAX Extensions and I have to say that I'm mighty impressed. What I love most is how the extensions support two flavours of AJAX:

  • Client-Side AJAX
    This is the AJAX that most of us are familiar with and typically has some client-side script grabbing data from the server and then modifying the DOM to present that information to the user. However, the extensions make this much easier by providing you with a great foundation on which to start. We'll look at this in part one of the series.
  • Server-Side AJAX
    This is the newer approach that the extensions also support and allow developers to Ajaxify their applications and keep their hands entirely clean of script whilst getting the most out of their ASP.NET controls.
The terms I've used above aren't 'standardized' yet but I'm hearing them more and more and they serve to quickly identify the difference. The easiest way to determine which is which is to consider where most of the code that is responsible for formatting the presentation of the AJAX call lives.

If you have a lot of Javascript working with the DOM it's probably client-side, whilst if all your presentation is taking place on the server it'll be server-side. Of course, there's nothing to stop you using both approaches in the same project - or even the same page - just choose the right tool for the task.

In the coming days I'll be looking at each through a little demo. The first, Ajaxed Part I. Client-Side AJAX is available now so why not check it out?

[1] Yes, I realise that this wasn't original and I wasn't the first, by a long shot.

See also... On the subject of being original, I started this article back in December but a colleague of mine, Granville Barnett has recently posted a very similar article to codeproject where he considers the two AJAX scenarios in terms of state. Go read it. The similarity in our examples is purely coincidental - promise! (he has a PeopleWebService.GetPeople() and I have PeopleService.GetPeople()...)

UPDATE: The second part Ajaxed Part II. Server Side AJAX is now available.

UPDATE: The AJAX Extensions have gone RTW (Release To Web) - find out more here.


Josh Post By Josh Twist
6:04 AM
19 Jan 2007

» Next Post: Ajaxed Part I. Client side AJAX
« Previous Post: XHTML Validator For All

Comments are closed for this post.

© 2005 - 2022 Josh Twist - All Rights Reserved.