Summary
Microsoft .NET Development Series "Supported by the leaders and principal authorities of core Microsoft technologies, this series has an author pool that combines some of the most insightful authors in the industry with the lead software architects and developers at Microsoft and the developer community at large." Don Box Architect, Microsoft "This is a great resource for professional .NET developers. It covers all bases, from expert perspective to reference and how-to. Books in this series are essential reading for those who want to judiciously expand their knowledge base and expertise." John Montgomery Principal Group Program Manager, Developer Division, Microsoft "This foremost series on .NET contains vital information for developers who need to get the most out of the .NET Framework. Our authors are selected from the key innovators who create the technology and are the most respected practitioners of it." Brad Abrams Group Program Manager, Microsoft ASP.NET AJAX server controls can encapsulate even the most powerful AJAX functionality, helping you build more elegant, maintainable, and scalable applications. This is the first comprehensive, code-rich guide to custom ASP.NET AJAX server controls for experienced ASP.NET developers. Unlike other books on ASP.NET AJAX, this book focuses solely on server control development and reflects the significant improvements in ASP.NET 3.5 AJAX and the latest Visual Studio 2008 features for streamlining AJAX development Adam Calderon and Joel Rumerman first review the core Microsoft AJAX Library and JavaScript techniques needed to support a rich client-side experience. Next, they build upon these techniques showing how to create distributable AJAX-enabled controls that include rich browser-independent JavaScript client-side functionality. The authors thoroughly explain both the JavaScript and .NET aspects of control development and how these two distinct environments come together to provide a foundation for building a rich user experience using ASP.NET AJAX. Create object-oriented cross-browser JavaScript that supports .NET style classes, interfaces, inheritance, and method overloading Work with components, behaviors, and controls, and learn how they relate to DOM elements Learn Sys.Application and the part it plays in object creation, initialization, and events in the Microsoft AJAX Library Build Extender and Script controls that provide integrated script generation for their corresponding client-side counterparts Localize ASP.NET AJAX controls including client script Discover ASP.NET AJAX client and server communication architecture and the new support for Windows Communication Foundation (WCF) Understand ASP.NET AJAX Application Services Create custom Application Services Design controls for a partial postback environment Understand the AJAX Control Toolkit architecture and the many features it provides Develop highly interactive controls using the AJAX Control Toolkit
Author Biography
Adam Calderon is a C# MVP and the Application Development Practice Lead at InterKnowlogy. He is an accomplished software developer, author, teacher, and speaker with more than 14 years of experience designing and developing solutions on the Microsoft platform. His involvement with ASP.NET AJAX began in late 2005 with his participation in the ASP.NET ATLAS First Access program and later as a member of the UI Server Frameworks Advisory Council. Adam was one of the fortunate few who were able to work on a production application that utilized ASP.NET AJAX in its alpha form and experienced firsthand the trials and tribulations of working in “beta land” on this exciting technology. Visit Adam's blog at http://blogs.interknowlogy.com/adamcalderon.
Joel Rumerman is a Senior .NET Developer at the CoStar Group, where he develops ASP.NET applications to support the company’s commercial real estate information business. He is an adept software developer with more than eight years of experience developing .NET applications and is active in the San Diego .NET community as an author and speaker. Joel has been working with ASP.NET AJAX since late 2005 when he started work on a large-scale application for a worldwide independent software vendor. This initial entry into the ASP.NET AJAX world provided him invaluable experience as he worked closely with Microsoft as a member of the ATLAS First Access program and participated in a Strategic Design Review of the technology. Joel has gone on to implement many more solutions using ASP.NET AJAX, including a Virtual Earth mash-up that maps commercial real estate properties. Visit Joel's blog at http://seejoelprogram.wordpress.com.
Table of Contents
Foreword | p. xxv |
Preface | p. xxvii |
Acknowledgments | p. xxxv |
About the Authors | p. xxxix |
Client Code | |
Programming with JavaScript | p. 3 |
Microsoft AJAX Library Programming | p. 51 |
Controls | |
Components | p. 121 |
Sys.Application | p. 169 |
Adding Client Capabilities to Server Controls | p. 207 |
ASP.NET AJAX Localization | p. 255 |
Control Development in a Partial Postback Environment | p. 317 |
Communication | |
ASP.NET AJAX Communication Architecture | p. 371 |
Application Services | p. 425 |
AJAX Control Toolkit | |
ASP.NET AJAX Control Toolkit Architecture | p. 481 |
Adding Client Capabilities to Server Controls Using the ASP.NET AJAX Control Toolkit | p. 513 |
Appendixes | |
JavaScript in Visual Studio 2008 | p. 547 |
Validating Method Parameters | p. 555 |
ASP.NET Handlers and Modules | p. 559 |
Client Error Handling Code | p. 569 |
Index | p. 577 |
Table of Contents provided by Publisher. All Rights Reserved. |
Excerpts
Preface Preface IntroductionServer controls are an integral aspect of every ASP.NET application we build. They encapsulate browser appearance and server functionality in a reusable object. They can be used across multiple pages within a single ASP.NET application as well as across multiple ASP.NET applications. ASP.NET comes with a lot of prebuilt server controls. We have simple controls such as the label and we have complex controls such as the GridView. We also have the ability to create our own server controls to meet a need not met by one of the existing controls by inheriting from the appropriate base class and overriding its methods as needed.This model of using server controls to encapsulate browser appearance and server functionality has served our needs well since the inception of ASP.NET 1.0, but our server control needs are changing.A new server control need that has recently surfaced is the ability to incorporate Ajax functionality directly into the server control.This need arose because our web applications need to be more responsive and visually interactive than the traditional ASP.NET repaint-the-entire-screen model and therefore the traditional server control supplies. This requirement has emerged because users are using web sites such as Gmail, Live.com, Yahoo! Mail, and others that don't repaint the screen every time they click a button or need to receive fresh data. Rather, they rely on Ajax to fetch fresh data and then update or add to a portion of the screen based upon that data. Because these web sites are heavily used and users really enjoy their experience while using these websites they expect other web sites to perform with the same elegance as they do. When a web site doesn't perform with the same elegance the user will often move onto another web site that does. Those popular applications have raised the bar for what is an acceptably user-friendly web site.Because our users are demanding a web site experience that essentially uses Ajax and we build our ASP.NET web sites using server controls, we need a way of easily creating server controls that not only encapsulate browser appearance and server functionality, but also include Ajax functionality so that the server control itself is Ajax-enabled.Taking a step back for a moment, unlike other technologies you might have read books on, ASP.NET AJAX server controls don't provide you with anything that you couldn't already do. We've always been able to embed Ajax-functionality into server controls ... it was just a real pain.There were a few different methods we could use to include the JavaScript with our server control such as embedding it as a resource, but we eventually ended up having to do the same three tasks. To make our server control have some serious client capabilities we always had to concatenate strings together to form JavaScript statements and functions, write browser sniffing statements to make sure that the JavaScript was cross-browser compatible, and add attributes or render out Html that attached the JavaScript functionality to the client versions of our server controls. It wasn't impossible, but it was error-prone and there was always this mingling of server code and JavaScript that was hard to maintain and even harder to read.Furthermore, if you had multiple server controls that had client capabilities it was difficult (but not impossible) to ensure that the client functions that each server control required didn't overwrite each other when rendered on the browser. Tracking down that problem was always a fun hour or so.The difficulty grew exponentially if we wanted to include a mechanism for asynchronously communicating with the server when the user pressed a button embedded in the server control. Even with a helper communication library there were always tri