Monday, February 8, 2010

What Is ASP.NET 2.0 AJAX?

On June 28, 2005, Microsoft announced “ASP.NET 2.0 AJAX.” ASP.NET 2.0 AJAX is an AJAX-oriented .NET library that runs on .NET 2.0. Though ASP.NET 2.0 AJAX is an AJAX library and can be used to perform AJAX operations, it is really much more. ASP.NET 2.0 AJAX offers many of the same types of features of the server-side ASP.NET, but it is directed at the client side. Because ASP.NET 2.0 AJAX is fully integrated with ASP.NET, it provides rich integration with the services provided by ASP.NET.

ASP.NET 2.0 AJAX provides the following features (and much more):

  • AJAX-style communications between client and server. This communication is over web services.
  • Asynchronous communication. All client-to-server communication in the ASP.NET 2.0 AJAX framework is asynchronous.
  • A set of server-side controls that enable rich client-side functionality.
  • A set of client-side controls and classes that further enable client-side functionality.
  • A framework for encapsulating client-logic through the creation of namespaces and classes.
  • Cross browser support. Although there is no official matrix of web browsers that ASP.NET 2.0 AJAX supports, the latest versions of Internet Explorer, Firefox, and Safari are supported. In addition, Opera is thought to be supported; however, we have not been able to find an official statement from Microsoft regarding this.

Running ASP.NET AJAX Applications

Unfortunately, not all web browsers ever produced will support ASP.NET AJAX. To run an ASP.NET AJAX application, a web browser must:

  • Be relatively modern — ASP.NET AJAX applications are not available in all versions of all web browsers. Though Internet Explorer version 6 and later, Firefox version 1.5 and later, and Safari provide support for these applications, older versions may be problematic because of their support for different versions of the other requirements.
  • Support the DOM — The capability to update form elements on a page based on new data is important. Accessing the controls in a standard way means that writing code that runs over a majority of web browsers is easier than having code that has a large number of if/then/else statements that are dependent on the browser version.
  • Support JavaScript — ASP.NET AJAX requires some amount of actions to occur out on the client. These actions are done using the JavaScript programming language. Because the major web browsers support JavaScript, it makes sense for JavaScript to be used for the client-side programming language.
  • Possibly have ActiveX enabled on the client — If you are using the Internet Explorer 6 browser while running on Windows, you may have problems if ActiveX is not enabled.

ASP.NET 2.0 AJAX falls into four areas:

Server-side controls — Server-side controls generate the appropriate client-side markup and script to perform client-side operations without the need for a postback. These controls provide a fairly easy environment to debug. For example, debugging with the UpdatePanel is fairly easy. Besides the UpdatePanel, other controls that work similarly are the ASP.NET AJAX Control Toolkit.

Client-side classes — These classes provide additional functionality to the client-side browser. This type of functionality is similar in concept to the base class libraries included in the .NET framework. An example would be the whole Sys.Net namespace along with the extensions to the base JavaScript objects.

Web services integration — This functionality allows a developer to use web services as the communication channel between the web browser and the web server without having to understand the differences between the MSXML component in IE and the XmlHttpRequest object in Firefox.

No comments:

Post a Comment