AJAX in Classic ASP websites
By Mike Irving - Published: 1/7/2008

For a while now I've been writing AJAX-Enabled ASP.Net 2.0 Web Applications in Visual Studio 2005, but last week I got the opportunity to add some new functionality to a website that used AJAX in ASP.

Essentially, the technique is very simple, though you'll have to handle everything manually, as opposed to AJAX-Enabled .Net Web Applications in which the UpdatePanel does most of the work for you.

Essentially, AJAX Functionality consists of a two-step process.

  1. Send some information Asynchronously to the Web server, following an event triggered in the Browser.
  2. Retrieve a response from the Server, and make the required visual change in the Browser
In Step 1, you will create an XMLHttpRequest object to call your Server-Side AJAX Handler, and pass some data to the handler.

In Step 2, you need to retrieve the Response from the Server, usually XML, and update the page accordingly with this data.

Whilst the process is taking place, you may also wish to display a "Please Wait" message, or show a progress animation to the user.

Using AJAX in ASP is a much more hands-on, and manual, process. However, it does ensure that you have complete control over exactly what is sent to and from the server.

You don't even have to return XML if you do not wish to, it is entirely up to you.

Whilst the UpdatePanel technique in ASP.Net is a lot quicker to implement, it may not be very efficient, and could create a lot of extra load on the server after multiple Asyncronous Postback events are triggered by a page, as large chunks of XML may be in transit.

View Blog Entries...
Page: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11