AJAX, ASP.NET AJAX, and Partial Rendering

There's a growing debate in the industry about the role of partial rendering


May 06, 2008
URL:http://www.drdobbs.com/windows/ajax-aspnet-ajax-and-partial-rendering/207501885


AJAX is not something you can download and install. It's more like a design pattern: It is a model for building Web applications and requires understanding and interpretation. Being a model, AJAX is platform and browser independent. A number of practical suggestions for architects of AJAX solutions have been worked out in the past few years. And they are, again, platform independent and apply to ASP.NET as well as PHP.

But Microsoft provides a fully-fledged AJAX platform on top of ASP.NET and integrates in it a number of common techniques and embraces a number of common suggestions. ASP.NET AJAX is something you can just download and install.

All AJAX books suggest that you create, or anyway get, a JavaScript cross-browser library for updating the DOM and implementing some special effects. In ASP.NET AJAX, you just have this library as a native component of the platform.

AJAX development requires new patterns too as AJAX surely solves a number of problems but also raises quite a few new ones. In ASP.NET AJAX, you don't need to learn about new patterns because the framework allows you to do AJAX on top of the existing ASP.NET application model. This technique is known as "partial rendering".

There's a growing debate in the industry about the role of partial rendering.

To some, partial rendering looks like the old-fashioned way of doing things. They would like to move away from partial rendering mostly because it is not perceived to be cool and trendy.

To others, partial rendering is just right and they would hate to move away from it mostly because they hate doing any JavaScript.

As usual, the truth is somewhere in the middle of these two extremes. Technically speaking, partial rendering plays a clever trick to turn a classic ASP.NET postback into an AJAX asynchronous postback. The request is managed from the page in the traditional way, except that it is delivered to the Web server using an out-of-band channel and bypassing the classic browser pipeline. In doing so, the ASP.NET AJAX framework relies on the browser's XmlHttpRequest object and skips automatic page reloads.

So Is It AJAX or Not?

This is not probably the right way of looking at things. The previous question does have an answer and the answer is no. AJAX is a change of paradigm; with partial rendering you use the same application model of classic ASP.NET.

The right question is, how effective is partial rendering?

It updates portions of the page asynchronously, thus incarnating the primary effect that people expect from AJAX solutions. For the vast majority of applications, partial rendering is just fine. Most applications would benefit from an AJAX-based facelift. As a developer, you can apply partial rendering to a given page in a matter of minutes and without learning curves. It is all about identifying which regions of the page would refresh independently and based on which events.

Partial rendering is a solution that can be applied at the page level. As you can see, it doesn't require a complete re-engineering of the application. Doing full AJAX requires a lot of design upfront. And it's a work that hides a number of pitfalls. Choosing a pure AJAX solution instead of a mix of partial rendering plus some loose scripting is a critical choice that may severely affect your budget. There's no out-of-the-box test to give you advice; the required level of interactivity of the final application is the most significant variable to consider. Partial rendering is more expensive than plain AJAX calls; but not always so expensive to justify a full redesign of the system. This may be really costly. AJAX is a trade-off and there's no prepacked solution to make and keep your users happy.

Terms of Service | Privacy Statement | Copyright © 2024 UBM Tech, All rights reserved.