I just completed reading the book ASP.NET Ajax In Action and thought I would share my opinion of the book. While I have read various blogs and articles on AJAX, I am just now starting to implement it into our main enterprise level application, and wanted a book to really get me started in the right direction.
Overall I feel the content of the book is very good and the topics are delivered in an easy to read format. I really like the layout of the book, and feel the chapters were organized very nicely. I did not feel like the authors jumped around from topic to topic too much, and the flow of the book felt very natural.
For developers that are new to AJAX and JavaScript, then they will appreciate the first couple of chapters where those topics are addressed. There are two chapters devoted to JavaScript that will be useful to beginners as well as experienced JavaScript developers. These chapters will be useful for seasoned JavaScript developers because you will get a feel for some of the conventions that are used within the library, as well as how the client library is structured.
The book then moves to the introduction of the server extensions that are provided by Microsoft. We are introduced to the ScriptManager and what its role is in regards to the page life cycle on the client and the server. We are also introduced to the UpdatePanel and partial page updates and how they help eliminate the visual aspect of the postback.
The book really starts to get good when it dives into the UpdatePanel and how the framework provides tools to help integrate the client and server. The authors go into some of the advanced topics related to the UpdatePanel, and also discuss some of the limitations related to the control. Then they start talking about creating client components, extenders, and controls. They provide a good level of detail on how to create each of these different types of components on the client side. They then teach you how to take what you just did on the client and make it interact with the server architecture that we are already familiar with.
Finally, the book wraps up with a look at what is coming in the next version of ASP.NET AJAX. They go over XML Script and the drag and drop engine that is currently in development. They also discuss various patterns related to AJAX that help you build better AJAX applications.
Overall, I really liked this book. While I have read various articles and blogs about AJAX, this is my first book on the topic and I feel that I have a really good grasp to apply AJAX to our enterprise level application.
Chapter by Chapter Look
Chapter 1 – Introducing ASP.NET AJAX
This chapter offers a good introduction to AJAX and how AJAX was added to ASP.NET. The chapter provides the goals of ASP.NET AJAX and also introduces you to the two approaches to how to implement AJAX within your application: the server centric solution and client centric solution.
Chapter 2 – First steps with the Microsoft Ajax Library
This chapter focuses on the JavaScript library that is provided by Microsoft. There is a good high level overview of the various features provided by the library, as well as an introduction to the new client side lifecycle that they expose. The authors also review the abstraction API that was created to hide the incompatibilities with all of the browsers when dealing with the DOM and JavaScript. They discuss positioning, events, and CSS, all of which have browser incompatibility issues. Finally, the authors wrap up with a review of new JavaScript objects and concepts that exist in the library that make JavaScript more familiar to .Net developers. They review objects and concept such as string builders, arrays, formatting, and globalization.
Chapter 3 – JavaScript for Ajax developers
If you are new to JavaScript, then this chapter will be real helpful. The authors dive into JavaScript and cover some of the most important concepts such as scope, closures, and prototypes. This is a real good introduction to get you up to speed with JavaScript. They also go into details about how the Microsoft library tries to introduce true OO into JavaScript by explaining how the library allows a developer to create classes, interfaces, enumerations, and base classes.
Chapter 4 – Exploring the Ajax server extensions
The authors now start to focus on the server side aspect of ASP.NET AJAX. They start with explaining the role of the ScriptManager and how it manages JavaScript files and provides the ability to register services that you can access through script. This chapter also discusses the basics related to partial page updates, the update panel, and the timer object. The chapter wraps up with how to handle exceptions from the server and how they integrate in with the custom error section of the web.config file.
Chapter 5 – Making asynchronous network calls
This chapter focuses on creating web services that can be called from the client to exchange data between the client and the server. The authors outline the steps involved in creating and register web services so they can be used by AJAX enabled web sites and also explains how you can invoke the web service using the Microsoft AJAX Library. The concept of creating a complex type on the client and the server is also discussed. Next, the authors discuss a new concept that is available in the ASP.NET futures CTP, called Bridges, which is an alternative for communicating with remote services. The authors wrap up the chapter with a discussion of ASP.NET application services, which are remote services that expose the authentication and profile services that exist in ASP.NET.
Chapter 6 – Partial-page rendering with UpdatePanels
To start the chapter, the authors start with a simple ASP.NET site that has traditional postbacks, and then demonstrate how UpdatePanels can eliminate those postbacks with no code changes. The authors explain the various update modes related to the UpdatePanel and how to trigger an update to the panels. The ASP.NET page lifecycle is reviewed and the authors explain how the UpdatePanel is affected by the various stages of the life cycle. They wrap up the chapter by providing a more advanced example of using an UpdatePanel to apply AJAX functionality to the GridView control. They use the UpdatePanel to take over the filter and sorting functionality as the user types in a filter string.
Chapter 7 – Under the hood of the UpdatePanel
The authors wrap up their coverage with the update panel by diving into the inner working of how it works. They cover how to interact with update panels on the client side and how the PageRequestManager works and the different events that the object expose to your application.
Chapter 8 – ASP.NET AJAX client components
This chapter really focuses on how a developer can take what they know about creating controls and objects on the server, and recreating those objects and controls on the client. We are introduced to how to create non-visual and visual components, including behaviors and controls on the client side and the object model that exists to assist us in creating those objects. This expands on the inner workings of the Microsoft Library a bit, and what has been provided to us to make it easier to recreate our server components on the client.
Chapter 9 – Building Ajax-enabled controls
The authors now move back to the server and expand on what was covered in chapter 8 by talking about how to take what you created in chapter 8 and make it accessible from the server. They introduce us to the ExtenderControl and ScriptControl base classes as well as the IExtenderControl and IScriptControl interfaces. The classes and interfaces lay the groundwork so we can build extenders and AJAX controls. The authors explain how these interfaces and base classes help you automatically wire up the server side controls to the client side controls.
Chapter 10 – Developing with the AJAX Control Toolkit
Considering one of the authors are involved in the development of the toolkit, it would make sense that there would be a chapter about it. This chapter does not explain each and every control, but rather focuses on the API the toolkit provides to make it easier to create extenders and controls. The toolkit introduces a few new base classes and provides some attribute classes to help make the development of extenders and controls easier. The chapter wraps up by talking about the framework that exists to assist with animations and visual effects.
Chapter 11 – XML Script
This chapter is the first of two chapters that talk about ASP.NET AJAX Futures, and talks specifically about XML Script. It provides examples of how to use XML Script to create and wire up client components. The authors also explore a feature of XML Script called bindings. This allows automatic synchronization between properties of two objects.
Chapter 12 – Dragging and dropping
One of the most exciting pieces of eye candy when it comes to AJAX applications, has to do with drag and drop functionality. The authors spend a chapter explaining the drag and drop engine that is coming in the next release. They talk about how you would need to implement a few interfaces in order to support this feature. They wrap up the sample by creating a shopping cart application.
Chapter 13 – Implementing common Ajax patterns
The final chapter of the book discuss a few patterns related to versioning, debugging, and how to make your JavaScript files smaller in size. The authors even provide some functions that you can use for shortcuts when you are wiring up events and creating properties. Finally, the chapter wraps up by talking about the navigation issues related to AJAX, and some solutions to breaking the back button in the browser.