O'Reilly logo

Learning ASP.NET 2.0 with AJAX by Dan Hurwitz, Jesse Liberty, Brian MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Snappier Web Sites with AJAX

AJAX has revolutionized ASP.NET, and from this moment forward most ASP.NET applications will routinely integrate AJAX controls. AJAX moves ASP.NET applications from being 99% server-side code, to offering the option for a great deal of the processing to happen on the user's browser. The net effect is a tremendous increase in both real and perceived performance of ASP.NET applications.

To demonstrate how much more dynamic and responsive AJAX is, you'll rewrite the order form from Chapter 2, applying Ajax techniques. You'll enhance the site by adding a watermark to user entry fields. A watermark is a bit of text that appears in the text field itself, but disappears as soon as the user starts typing. It serves as an elegant prompt to the user. You will also create a pop-up panel to hide controls until the user needs them, and you'll add a collapsible text field to display product information in a very space-efficient manner.

Take a Walk on the Client Side

While server-based web applications have wonderful advantages, they have the obvious disadvantage that any time you want to run any code (or retrieve any data) you must endure the cost of a "round trip" from the browser to the server and back, and the page must be redrawn from scratch. Round trips can be slow (though the Internet is getting faster all the time) and redrawing the page causes a noticeable flicker.

AJAX (which more accurately should be spelled AJX, but that's harder to pronounce) is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required