Three Patterns of Constructing an ASP.NET AJAX-based Applications
(Page 1 of 4 )
As one of the full-fledged AJAX frameworks, Microsoft ASP.NET AJAX holds many excellent features that deserve to be carefully explored. In this article, we will focus on one topic -- how to use the Microsoft ASP.NET AJAX framework ("MS AJAX" for short later on) to develop web applications under three different circumstances.
A
downloadable .rar file is available for this article.
These circumstances will include rebuilding a legacy ASP.NET 2.0 application, creating a "sheer" MS AJAX application from scratch, and constructing a web application that runs on a non-ASP.NET 2.0 server side platform.
Author's Note: To follow along with the samples in this article, I've assumed that you have installed Visual Studio 2005 as well as all three components of MS AJAX: ASP.NET AJAX Extensions, ASP.NET AJAX Control Toolkit, and ASP.NET AJAX Futures January/May CTP.
Now, let's first concentrate on the main features that attract us in constructing the following samples.
A Comparison Between the Server-side and Client-side Solutions
Since MS AJAX supplies different solutions for the server side and the client side, let's take a look at Table 1 for a brief comparison.
Table 1 Comparison of the server-side and client-side solutions
Features | Server-side Implementation | Client-side Implementation |
performance | low | high |
functionality | weak | strong |
difficulty | low | high |
cross platform (the server side) capability | nonsupport | full support |
As you can see from Table 1 above, there are four distinct differences between the server side and the client side, as follows:
1. Performance. As is well known, AJAX applications will run on client-side browsers. Therefore, whether or not the implementing modes are accomplished through server-side technologies, the ultimate result will be converted into JavaScript code and run on client-side browsers. The server-side mode, however, will generate JavaScript code at run-time and send it to the client side, which obviously causes the burden to fall onto the server side and thus reduces the performance of the whole system.
2. Functionality. ASP.NET AJAX Extensions merely provide a few server-side controls with few functions (but note that the ASP.NET AJAX Control Toolkit brought out quite a few server-side controls, with the number still increasing). In contrast, there are plenty of ASP.NET AJAX client-side controls, with a rather integrated architecture and perfect functionalities, which to some degree compare beautifully with the built-in server-side ASP.NET 2.0 controls.
3. Difficulty. Thanks to the pattern of the MS AJAX server side, which is similar to that of ASP.NET 2.0, ASP.NET 2.0 developers can quickly familiarize themselves with the MS AJAX server-side model and improve their development efficiency with the fully built-in supporting features (such as compile time check and Intelli-Sense technique) of Visual Studio 2005, with no further requirement for JavaScript coding ability. However, with a wide divergence from the server side implementation, to use the MS AJAX client-side mode, you have to abandon all your current ASP.NET knowledge and the associated development flow to learn and accept a new development pattern -- ASP.NET AJAX xml-script -- and endure various inconveniences. What most dismays developers may be that there are presently no IDEs with excellent support of JavaScript programming and debugging.
4. Server-side cross platform capability. Since the infrastructure of MS AJAX server-side controls is based on the ASP.NET 2.0 architecture, they can only run on the server side based on ASP.NET 2.0, and are unable to run on non-ASP.NET 2.0 server-side platforms. Nevertheless, all the MS AJAX client-side controls are implemented based on standard cross-platform JavaScript irrelevant to the server-side techniques, so we can run them on non-ASP.NET 2.0 server-side platforms. For example, PHP developers can manually add references to the relevant MS AJAX client-side JavaScript libraries to improve the client-side capability.
Next: Choosing the Pattern Most Suitable for You >>
More ASP.NET Articles
More By Xianzhong Zhu