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 Understand AJAX Control Toolkit architecture and build controls that utilize the toolkit Foreword xxv Preface xxvii Acknowledgments xxxv About the Authors xxxix Part I: Client Code Chapter 1: Programming with JavaScript 3 Chapter 2: Microsoft AJAX Library Programming 51 Part II: Controls Chapter 3: Components 121 Chapter 4: Sys.Application 169 Chapter 5: Adding Client Capabilities to Server Controls 207 Chapter 6: ASP.NET AJAX Localization 255 Chapter 7: Control Development in a Partial Postback Environment 317 Part III: Communication Chapter 8: ASP.NET AJAX Communication Architecture 371 Chapter 9: Application Services 425 Part IV: AJAX Control Toolkit Chapter 10: ASP.NET AJAX Control Toolkit Architecture 481 Chapter 11: Adding Client Capabilities to Server Controls Using the ASP.NET AJAX Control Toolkit 513 Appendixes Appendix A: JavaScript in Visual Studio 2008 547 Appendix B: Validating Method Parameters 555 Appendix C: ASP.NET Handlers and Modules 559 Appendix D: Client Error Handling Code 569 Index 577
Author(s): Adam Calderon, Joel Rumerman
Edition: 1
Publisher: Addison-Wesley Professional
Year: 2008
Language: English
Pages: 628
Contents......Page 5
Acknowledgments......Page 31
About the Authors......Page 34
I: Client Code......Page 35
1 Programming with JavaScript......Page 37
Generally JavaScript......Page 38
Strings......Page 42
Object-Oriented JavaScript Programming......Page 73
2 Microsoft AJAX Library Programming......Page 85
Extending the Built-In JavaScript Types......Page 86
Extending the Microsoft AJAX Library......Page 94
Important New Types......Page 122
Maintaining Scope......Page 146
II: Controls......Page 152
Components Defined......Page 153
Sys.Component......Page 157
Controls......Page 183
Behaviors......Page 191
Background Information......Page 200
Component Manager......Page 207
Initialization Routine......Page 216
The Unload Routine......Page 234
5 Adding Client Capabilities to Server Controls......Page 238
Script-Generation Architecture......Page 239
Adding Client-Side Behavior Using the ExtenderControl......Page 251
Adding Client-Side Functionality Using the ScriptControl......Page 264
Adding Client-Side Functionality to Composite Controls Using the IScriptControl Interface......Page 278
Localization in ASP.NET......Page 286
Localization in ASP.NET AJAX......Page 308
7 Control Development in a Partial Postback Environment......Page 348
UpdatePanel Behavior......Page 349
The Effects of a Partial Postback on Client Components......Page 355
Loading of JavaScript Statements and Files......Page 386
Sys.Application Events......Page 395
III: Communication......Page 400
8 ASP.NET AJAX Communication Architecture......Page 401
New Communication Paradigm......Page 402
ASP.NET AJAX 2.0 Extensions Communication Architecture......Page 404
Microsoft AJAX Library Communication Architecture......Page 431
ASP.NET 2.0 Membership, Role, and User Profile Services......Page 455
ASP.NET AJAX Application Services......Page 478
Custom Application Services......Page 490
IV: AJAX Control Toolkit......Page 509
10 ASP.NET AJAX Control Toolkit Architecture......Page 510
Overview of the Toolkit......Page 511
Composition of the Toolkit......Page 512
Server-Based Architecture......Page 515
Client-Based Architecture......Page 528
Animations......Page 530
Adding Client-Side Behavior Using the ExtenderControlBase......Page 542
Adding Design-Time Support to Your Extender Control......Page 553
Adding Animations to Your Extender Control......Page 561
V: Appendixes......Page 573
IntelliSense......Page 574
XML Comments......Page 578
B: Validating Method Parameters......Page 582
ASP.NET Application Lifecycle......Page 586
HTTP Handlers......Page 587
HTTP Modules......Page 592
ErrorHandler Client Class......Page 596
ErrorHandler Server Control......Page 598
StackTrace Client Class......Page 599
Test Error Page......Page 601
A......Page 603
B......Page 606
C......Page 607
D......Page 610
E......Page 611
F......Page 613
I......Page 614
J......Page 615
M......Page 616
O......Page 619
P......Page 620
Q–R......Page 622
S......Page 623
T......Page 625
U......Page 626
W......Page 627
X–Z......Page 628