You are on page 1of 8

Contents

Acknowledgments
Introduction

ix
xix

RI

Development Trends
ASP.NET Development

TE

Design Methodology
Problems ASP.NET Solves

GH

TE

Advantages of Ajax
History of Ajax
Technologies That Make Up Ajax
Running Ajax Applications

MA

So, Whats the Problem?


Improving the User Experience
What Is Ajax?

Whos Using Ajax?


Problems Ajax Wont Solve
Summary

AL

Chapter 1: Introduction to Ajax on ASP.NET

RI

Chapter 2: Introduction to DHTML

PY

What JavaScript Is, and What It Isnt


General Rules of JavaScript
Writing Your First Block of JavaScript Code

CO

document.write()
Using document.write() in Nested for() Loops
window.status and Events

Getting Input from the User


Security Concerns When Getting Text Input
Canceling the Normal Outcome of an Event
Causing an Event Not to Bubble Up

Working with Images


Working with the image src Attribute
Using Functions
Programmatically Populating the Options in <select>
Using the innerHTML Property

1
1
2
2
2

4
5
6
6
7
8
8

9
9
10

11
11
12
13
14
14
16

17
18
18
19

19
20
20
21
23

Contents
Manipulating the Style Sheet
Creating a Context Menu
Summary

Chapter 3: JavaScript and the Document Object Model


From Static to Dynamic A Brief History
Attempts at Standardization
Digging into Some More JavaScript Basics
Functions and Syntax
Event Handlers

Core Language
Variables
Comments
Datatypes
Operators and Expressions
Flow Control and Loops
More on Objects and Functions
Summary of Material So Far

The Document Object Model


Object Model Standardization (or Lack Thereof)
Working with the DOM
Manipulating Nodes
Properties of a Node
DOM Level 0 General Collections
The DOM, Styles, and CSS

Summary

24
26
27

29
30
30
31
33
34

35
35
35
36
39
40
43
51

51
53
57
62
64
69
70

74

Chapter 4: The XMLHttpRequest Object

77

Code Examples for This Chapter


What Is the XMLHttpRequest Object?

77
78

A Little History
Synchronous Requests
Asynchronous Requests
Dealing with Response Data
Enhancing Usability
Passing Parameters to the Server
What about Web Services?

Summary

xii

78
81
82
84
88
93
97

102

Contents
Chapter 5: Data Communication: XML, XSLT, and JSON
XML
History of XML
XML Documents
Parsing XML
XML Summary

XSLT
How Processing Occurs
Built-In Functions
Processing with XSLT
Writing Functions in XSLT

X Path
Integrating XML and Ajax
JSON
Layout of JSON
JSON Example

Summary

Chapter 6: What Is Built into ASP.NET

103
104
104
105
111
112

112
112
114
116
120

121
122
124
124
125

126

127

Out-of-the-Box Controls

127

TreeView Control
GridView Control
DetailsView Control

128
129
132

Browser Compatibility
The Framework

132
133

ICallbackEventHandler Interface
Page.ClientScript System.Web.UI.ClientScriptManager

Making All the Moving Parts Work Together


Obtaining a Callback Reference
Implementing the ICallbackEventHandler Interface
Initiating the Asynchronous Process from the Browser
Handling the Result of Asynchronous Server-Side Call on the Client
Handling Errors in the Asynchronous Process

Dealing with Complex Data


Enabling the Page for Asynchronous Callbacks
Obtaining the Data Implementing the ICallbackEventHandler interface
Dealing with the Returned Data on the Client
Limitations on Returning Complex Data in XML
ICallbackContainer Interface

Summary

133
134

135
135
136
138
138
141

144
145
146
149
154
154

156

xiii

Contents
Chapter 7: Ajax.NET Professional Library

159

Acquiring Ajax.NET Pro Version 6.4.16.1


Preparing Your Application
Using the Ajax.NET Pro Library

160
160
161

Registering Your Page for Ajax.NET Pro


Registering Your Methods for Ajax.NET Pro
Examining the Request Object
Executing Your Ajax on the Client
Digging into response.value
Returning Custom Objects
More Advanced Callbacks and Context
Ajax.NET Pro Request Events Keeping Your Users Updated
Errors, Errors, Errors. They Happen, You Trap em.

163
163
164
165
167
169
170
172
173

Using the Ajax.NET Pro Library Looking under the Hood

174

When Is the Proxy JavaScript Created?


What Does the JavaScript Do?
What Happens on the Server after the Proxy JavaScript Has Been Fired?
How Is the Method in the Code-Behind Actually Executed and
How Is the Page Actually Created?
What Is Really Being Sent Back to the Client

Summary

Chapter 8: Anatomy of Ajax.NET Pro Library


Getting the Ajax.NET Pro Code
What Do the Ajax.NET Pro Web.Config Settings Accomplish?
What Happens When You Register the Page Class?
What Role Does the Ajax.AjaxMethod() Attribute Play?
How Does the JavaScript Call Get to the Server and Back?
What Is an Ajax.NET Pro Converter?
Summary

Chapter 9: Other Ajax Frameworks for .NET


Client-Side Frameworks
Sarissa
HTMLHttpRequest
MochiKit

Server-Side Frameworks
Architectural Distinctions

Introduction to the Frameworks

xiv

175
176
176
177
177

177

179
180
182
183
191
192
193
194

195
195
196
199
201

203
203

207

Contents
ComfortASP.NET
Setup
Using ComfortASP.NET
What You Have Learned

MagicAjax
Setup
Using MagicAjax
What You Have Learned

Anthem.NET
Setup
Using Anthem.NET
What You Have Learned

Summary

Chapter 10: Atlas Client Script


Introduction to Atlas
Major Components
Ajax Support
Asynchronous Communication Only

Adding Atlas Support with the ScriptManager Control


Communicating with Web Services
Generating the JavaScript Proxies
Calling Out to Web Services

Passing Types
Simple Data Types
Complex Data Types

Caching Web Services


Exposing Web Services from a Web Form
Atlas Extensions to JavaScript
Language Enhancements
Registering Namespaces and Classes in Atlas
Namespaces and Classes
Inheritance
Interfaces
Enumerations

Debugging
Debugging Using debug.dump
Debugging Using for() loop

Special Notes Concerning Atlas Client-Side Script


Resources Used
Summary

208
208
209
219

219
219
220
231

231
231
232
246

246

249
249
250
251
251

252
253
253
255

257
257
258

263
265
267
267
273
274
276
277
280

281
281
283

283
283
284

xv

Contents
Chapter 11: Atlas Controls
Controls
Buttons
Sys.UI.Data Controls
Server Controls

Data Binding
Declarative Data Binding
Programmatic Data Binding
Binding Directions
Binding Transformations
Validation
Behaviors

Resources Used
Summary

Chapter 12: Atlas Integration with ASP.NET Services


Examining ASP.NET Services
Authentication
Authorization/Roles
Membership
Profiles
Web Part Personalization

Using Atlas to Integrate with ASP.NET Services


Authentication
Authorization/Roles

Accessing Profiles via Atlas


Profile Property Names
Loading Profile Data
Save Profile Data
Avoiding Profile Service Gotchas

Implementing Drag and Drop via Atlas


Summary

285
285
285
286
287

295
295
297
300
300
300
307

309
309

311
312
312
313
314
314
314

314
314
318

320
320
322
323
324

325
328

Chapter 13: Debugging

329

Server-Side Debugging

329

Enabling Debugging Support


Setting Breakpoints

xvi

330
331

Contents
JavaScript and Client-Side Debugging
Tools and Techniques of the Trade
Other Ways of Invoking the Debugger
Other Ways of Inspecting the Value of Variables
Script Debugging So Far
Browser Debugging Tools
The Man in the Middle

Summary

Appendix A: XSLT Commands


Index

332
332
342
344
347
347
351

361

363
373

xvii

You might also like