Alessandro Gallo, David Barkol, Rama Vavilala, Scott Guthrie, Bertrand Le Roy9781933988146, 1-933988-14-2
Table of contents :
ASP.NET AJAX in Action……Page 1
brief contents……Page 8
contents……Page 10
forewords……Page 18
preface……Page 22
about the authors……Page 32
ASP.NET AJAX basics……Page 36
Introducing ASP.NET AJAX……Page 38
1.1 What is Ajax?……Page 39
1.1.1 Ajax components……Page 40
1.1.2 Asynchronous web programming……Page 42
1.1.3 The XMLHttpRequest object……Page 45
1.1.4 Ajax development issues……Page 49
1.2 ASP.NET AJAX architecture……Page 50
1.2.1 Client framework……Page 51
1.2.2 Server framework……Page 54
1.2.3 Client-centric development model……Page 55
1.2.4 Server-centric development model……Page 56
1.2.5 ASP.NET AJAX goals……Page 57
1.3.1 Simple server-centric solution……Page 58
1.3.2 UpdateProgress control……Page 63
1.3.3 Simple client-centric example……Page 65
1.4 Summary……Page 69
First steps with the Microsoft Ajax Library……Page 71
2.1.1 Library features……Page 72
2.1.2 Ajax-enabling an ASP.NET page……Page 74
2.1.3 Script versions……Page 75
2.2 The Application model……Page 77
2.2.1 Client components……Page 78
2.2.2 Client-page lifecycle……Page 79
2.2.3 “Hello Microsoft Ajax!”……Page 80
2.3.1 The abstraction API……Page 83
2.3.2 A dynamic, cross-browser text box……Page 84
2.3.3 CSS and positioning……Page 88
2.3.4 Client delegates……Page 89
2.3.5 $addHandlers and $clearHandlers……Page 91
2.3.6 Callbacks……Page 92
2.4.1 The String object……Page 93
2.4.2 Sys.StringBuilder……Page 94
2.4.3 The Array object……Page 96
2.4.4 Globalization……Page 98
2.4.5 Browser detection……Page 100
2.4.6 Debugging……Page 101
2.4.7 Typed errors……Page 104
2.5 Summary……Page 107
JavaScript for Ajax developers……Page 108
3.1 Working with objects……Page 109
3.1.1 Objects……Page 110
3.1.2 Arrays……Page 111
3.1.3 Functions……Page 112
3.1.4 Creating custom objects……Page 116
3.1.5 The prototype object……Page 117
3.1.6 Extending a JavaScript type……Page 118
3.1.7 Literals……Page 120
3.2.1 JSON structures……Page 121
3.2.2 JSON and the Microsoft Ajax Library……Page 123
3.3.1 Client classes……Page 124
3.3.2 The registerClass method……Page 125
3.3.3 Properties……Page 126
3.3.4 Namespaces……Page 128
3.4.1 Prototype-based inheritance……Page 130
3.4.2 Passing arguments to the base class……Page 132
3.4.3 Overrides……Page 133
3.5.1 Interfaces……Page 134
3.5.2 Enumerations……Page 136
3.6.1 Reflection methods……Page 139
3.6.2 Object typing……Page 140
3.6.3 Building a simple class browser……Page 141
3.7 Working with events……Page 143
3.7.1 Exposing an event……Page 144
3.7.2 Subscribing to and handling events……Page 147
3.8 Summary……Page 148
Exploring the Ajax server extensions……Page 149
4.1.1 What are the Ajax server extensions?……Page 150
4.2 Enhancing an existing ASP.NET site……Page 151
4.2.1 A sample ASP.NET site……Page 152
4.2.2 Configuring an existing ASP.NET site……Page 153
4.3 ScriptManager: the brains of an Ajax page……Page 155
4.3.1 Understanding the ScriptManager……Page 156
4.3.2 Deploying JavaScript files……Page 157
4.3.3 Registering services……Page 158
4.3.4 Localization……Page 159
4.3.5 Using the ScriptManagerProxy……Page 161
4.4 Partial-page updates……Page 162
4.4.1 Introducing the UpdatePanel control……Page 163
4.4.2 More UpdatePanels……Page 166
4.4.3 Insert feedback here……Page 168
4.4.4 Working with a timer……Page 170
4.4.5 Error handling……Page 173
4.5 Summary……Page 175
Making asynchronous network calls……Page 176
5.1 Working with ASP.NET Web Services……Page 177
5.1.1 Configuring a web service……Page 178
5.1.2 Invoking web service methods from JavaScript……Page 181
5.1.3 Managing complex types……Page 185
5.1.4 Using HTTP GET……Page 193
5.1.5 Page methods……Page 194
5.2 The asynchronous communication layer……Page 195
5.2.1 A simple WebRequest……Page 196
5.2.2 The executor……Page 197
5.2.4 Handling errors……Page 198
5.3 Consuming external Web Services……Page 201
5.3.1 The script technique……Page 202
5.3.2 Cross-domain calls through the server……Page 203
5.3.3 Mash-it-up with ASP.NET AJAX……Page 204
5.3.4 Bridges……Page 210
5.4.1 Enabling ASP.NET application services……Page 218
5.4.2 Authentication service……Page 219
5.4.3 Profile……Page 222
5.4.4 Roles: an Orcas preview……Page 226
5.4.5 Message board application……Page 227
5.5 Summary……Page 228
Partial-page rendering with UpdatePanels……Page 229
6.1.1 Evolution of the UpdatePanel……Page 230
6.1.2 A simple example……Page 231
6.2.1 Content for the UpdatePanel……Page 236
6.2.2 Update modes……Page 238
6.2.3 Render modes……Page 240
6.2.4 ASP.NET page lifecycle……Page 242
6.3.1 Asynchronous triggers……Page 243
6.3.2 Postback triggers……Page 245
6.3.3 Manual triggers……Page 246
6.4.1 Repeating UpdatePanels……Page 248
6.5 Live GridView filter……Page 251
6.5.1 Live GridView filter goals……Page 252
6.5.2 How does the GridView filter work?……Page 253
6.5.3 Adding Ajax to the GridView filter……Page 258
6.5.4 It’s alive!……Page 259
6.6 Summary……Page 262
Advanced techniques……Page 264
Under the hood of the UpdatePanel……Page 266
7.1 The PageRequestManager: the unsung hero……Page 267
7.1.1 The client-side event model……Page 268
7.1.2 The anatomy of an asynchronous postback……Page 271
7.2 A client-side event viewer……Page 278
7.2.1 Getting started……Page 279
7.2.2 Handling client-side events……Page 280
7.2.3 Aborting a postback……Page 285
7.2.4 Managing postback priority……Page 286
7.2.5 Notifying the user……Page 287
7.2.6 Locked and loaded……Page 288
7.2.7 Client-side error handling……Page 290
7.3.1 Why is the UpdatePanel slow?……Page 291
7.3.2 Inject JavaScript during a partial postback……Page 293
7.3.3 Getting the validators to work……Page 295
7.3.4 Sys.WebForms.PageRequestManagerParseErrorException……Page 296
7.4 Caveats and limitations……Page 297
7.5 Summary……Page 298
ASP.NET AJAX client components……Page 299
8.1 The client component model……Page 300
8.1.1 Visual and nonvisual components……Page 302
8.1.3 Component lifecycle……Page 303
8.1.4 Containers……Page 304
8.2 Working with client components……Page 305
8.2.1 Creating components……Page 308
8.2.3 Events and property change notification……Page 311
8.3 Behaviors……Page 314
8.3.1 Sys.UI.Behavior……Page 315
8.3.3 Accessing behaviors……Page 316
8.3.4 Enhancing a text box element……Page 317
8.4.1 Sys.UI.Control……Page 322
8.4.2 Creating controls……Page 323
8.4.4 Creating an element wrapper: text box……Page 324
8.4.5 Creating a PhotoGallery control……Page 327
8.5 Summary……Page 333
Building Ajax-enabled controls……Page 334
9.1.1 Script descriptor hierarchy……Page 335
9.1.2 Describing a behavior……Page 337
9.1.3 Describing a control……Page 339
9.2 Introduction to Ajax-enabled controls……Page 341
9.2.1 How Ajax-enabled controls work……Page 342
9.2.2 Extenders and script controls……Page 343
9.3.1 The IExtenderControl interface……Page 346
9.3.2 Extender registration……Page 347
9.3.3 An extender for FormattingBehavior……Page 348
9.3.4 Using an extender……Page 351
9.4.1 The IScriptControl interface……Page 354
9.4.2 Script control registration……Page 355
9.4.4 Adding Ajax to the ASP.NET Login control……Page 357
9.4.5 Using a script control……Page 363
9.5 Summary……Page 365
Developing with the Ajax Control Toolkit……Page 367
10.1 A world of extenders……Page 368
10.1.1 The auto-complete extender……Page 369
10.1.3 The BehaviorID property……Page 375
10.2.1 The Toolkit’s base classes……Page 378
10.2.2 A metadata-driven API……Page 380
10.2.3 Building Toolkit extenders: the TextChanged extender……Page 382
10.2.4 Support for Visual Studio Designer……Page 390
10.3.1 Toolkit animation framework……Page 392
10.3.2 Animation basics……Page 394
10.3.3 Using the AnimationExtender……Page 395
10.3.4 The UpdatePanelAnimation extender……Page 399
10.3.5 JSON and animations: adding transitions to the PhotoGallery control……Page 400
10.4 Summary……Page 404
ASP.NET AJAX Futures……Page 406
XML Script……Page 408
11.1 XML Script basics……Page 409
11.1.1 Hello XML Script!……Page 410
11.1.2 Controls and XML Script……Page 413
11.1.3 From XML Script to JavaScript……Page 417
11.1.4 Type descriptors……Page 418
11.2 Actions……Page 421
11.2.1 SetPropertyAction……Page 422
11.2.3 InvokeMethodAction……Page 424
11.2.4 Custom actions……Page 429
11.3.1 A simple binding……Page 433
11.3.2 Binding direction……Page 435
11.3.3 Target and data path……Page 436
11.3.4 Bindings as components……Page 437
11.3.5 Transformers……Page 439
11.3.6 Playing with transformers……Page 440
11.3.7 Custom transformers……Page 443
11.4 Summary……Page 444
Dragging and dropping……Page 445
12.1 The drag-and-drop engine……Page 446
12.1.1 How the engine works……Page 447
12.1.2 A simple scenario for drag and drop……Page 450
12.1.3 Creating a draggable item……Page 451
12.1.4 The startDragDrop method……Page 453
12.1.5 The IDragSource interface……Page 454
12.1.6 Creating a drop target……Page 457
12.1.7 The IDropTarget interface……Page 458
12.1.8 Putting together the pieces……Page 461
12.2 A drag-and-drop shopping cart……Page 462
12.2.1 Server-side design……Page 464
12.2.2 Client-side design……Page 466
12.2.3 The ShoppingCart control……Page 467
12.2.4 The BooksCatalog control……Page 470
12.2.5 Piecing it together……Page 473
12.3 Summary……Page 475
Mastering ASP.NET AJAX……Page 476
Implementing common Ajax patterns……Page 478
13.1 Script versioning……Page 479
13.1.1 Getting informative stack traces……Page 480
13.1.2 XML comments in JavaScript code……Page 482
13.1.3 Validating function parameters……Page 484
13.1.4 Parameter validation in production code……Page 487
13.1.5 Compressing and crunching script files……Page 489
13.2 Helpers, help me help you!……Page 490
13.2.1 Automating the declaration of properties……Page 491
13.2.2 Automating the creation of events……Page 493
13.3 Logical navigation and unique URLs……Page 496
13.3.1 Logical navigation……Page 497
13.3.2 Unique URLs……Page 503
13.4.1 Setting up the Web Service……Page 505
13.4.2 The ListView control……Page 508
13.5 Declarative widgets……Page 511
13.5.1 The drag-drop list……Page 512
13.5.2 Widgets and XML Script……Page 514
13.6 Summary……Page 519
Appendices……Page 520
appendix A :Installing ASP.NET AJAX……Page 522
A.1 Downloading and installing ASP.NET AJAX……Page 523
A.1.2 Installing the ASP.NET Futures CTP……Page 526
A.2 Installing the Ajax Control Toolkit……Page 528
A.2.2 Using the Ajax Control Toolkit controls……Page 530
A.2.3 Interacting with CodePlex……Page 531
A.3 Installing the AdventureWorks database……Page 532
appendix B :Tools for debugging Ajax applications……Page 534
B.1 Using Firebug for Firefox……Page 535
B.1.1 Installing Firebug……Page 536
B.1.2 Quick Overview of Firebug……Page 537
B.2.2 Launching Web Developer Helper……Page 541
B.2.3 Inspecting HTTP traffic……Page 542
B.2.4 Script debugging and tracing……Page 544
B.2.5 Page and ASP.NET diagnostics……Page 546
B.3 Debugging HTTP with Fiddler……Page 547
B.4.1 Enabling script debugging in Internet Explorer……Page 551
B.4.2 Setting breakpoints……Page 552
B.4.3 Other ways to break into the debugger……Page 554
Resources……Page 556
index……Page 558
Reviews
There are no reviews yet.