Saturday, May 14, 2011

AJAX


Introduction - What is AJAX?

AJAX, or Asynchronous JavaScript and XML, is a fancy way to use JavaScript and XML to communicate with a web server without refreshing the web page. You can visit this web page for more information about AJAX; it has a good list of links.

Why use AJAX?

There are a couple of reasons to use AJAX in lieu of the traditional form submission. The first is that it is very light weight: instead of sending all of the form information to the server and getting all of the rendered HTML back, simply send the data the server needs to process and get back only what the client needs to process. Light weight means fast. The second reason to use AJAX is because (as the logo in the link above makes clear) AJAX is cool.


Asynchronous JavaScript + XML (AJAX) is essentially a branding term for a bundle of common web technologies. These include JavaScript, DHTML and a utility object called XMLHTTP. The short story is that in combination, these tools reduce the need for web browser applications to reconnect to a web server every time additional data is downloaded.

Not to be left behind, Microsoft has announced project Atlas for ASP.NET 2.0 and for ASP.NET 1.1, we already have Michael Schwarz's Ajax.Net.
According to one Atlas project member, “What we’ve set out to do is to make it dramatically easier for anyone to build AJAX-style web applications that deliver rich, interactive, and personalized experiences. Developers should be able to build these applications without great expertise in client scripting; they should be able to integrate their browser UI seamlessly with the rest of their applications; and they should be able to develop and debug these applications with ease.”
Atlas is being developed on top of ASP.NET 2.0 and is slated to contain the following components:

Atlas Client Script Framework
The Atlas Client Script Framework is an extensible, object-oriented 100% JavaScript client framework that allows you to easily build AJAX-style browser applications with rich UI and connectivity to web services. With Atlas, you will be able to write web applications that use a lot of DHTML, JavaScript, and XMLHTTP, without having to be an expert in any of these technologies.
The Atlas Client Script Framework will work on all modern browsers, and with any web server. It also won’t require any client software installations, only standard script references in the web page.
The Atlas Client Script Framework will include the following components:
  • An extensible core framework that adds features to JavaScript such as lifetime management, inheritance, multicast event handlers, and interfaces
  • A base class library for common features such as rich string manipulation, timers, and running tasks
  • A UI framework for attaching dynamic behaviors to HTML in a cross-browser way
  • A network stack to simplify server connectivity and access to web services
  • A set of controls for rich UI, such as auto-complete textboxes, popup panels, animation, and drag and drop
  • A browser compatibility layer to address scripting behavior differences between browsers.
ASP.NET Server Controls for Atlas
For ASP.NET applications, a new set of AJAX-style ASP.NET Server Controls will be developed and the existing ASP.NET page framework and controls will be enhanced to support the Atlas Client Script Framework.
The Atlas Client Script Framework will fully support ASP.NET 2.0 client callbacks, but will enrich the level of integration between the browser and the server. For example, you will be able to data bind Atlas client controls to ASP.NET data source controls on the server, and you’ll be able to control personalization features of web parts pages asynchronously from the client.

ASP.NET Web Services Integration
Like any client application, an AJAX-style web application will usually need to access functionality on the web server. The model for connecting to the server for Atlas applications is the same as for the rest of the platform – through the use of Web services.

With ASP.NET Web Services Integration, Atlas applications will be able to access any ASP.NET-hosted ASMX or Indigo service directly through the Atlas Client Script Framework, on any browser that supports XMLHTTP. The framework will automatically handle proxy generation, and object serialization to and from script. With web services integration, you can use a single programming model to write your services, and use them in any application, from browser-based sites to full smart client applications.