Home Page Icon
Home Page
Table of Contents for
I. ASP.NET AJAX Building Blocks
Close
I. ASP.NET AJAX Building Blocks
by Dino Esposito
Introducing Microsoft® ASP.NET AJAX
Copyright
Dedication
Acknowledgments
Introduction
Who This Book Is For
How This Book Is Organized
System Requirements
Configuring SQL Server 2005 Express Edition
Code Samples
Support for This Book
Questions and Comments
I. ASP.NET AJAX Building Blocks
1. The AJAX Revolution
The Paradigm Shift
Classic Web Applications
Send Input via Forms
Get Output through Pages
Capabilities and Drawbacks
AJAX-Based Web Applications
What Is AJAX, Anyway?
Update Pages via Script
The Document Object Model
The Role of Rich Browsers
Rich vs. Reach
Required Capabilities
The AJAX Core Engine
The XMLHttpRequest Object
The Internet Explorer Object
The Mozilla Counterpart
XMLHttpRequest in Internet Explorer 7
An HTTP Object Model
Behavior and Capabilities
Sending a Request
Receiving a Response
Roll Your Own (Little) AJAX Framework
Executing an Out-of-Band Call from an ASP.NET Page
Displaying Results
The Switch to the Document Object Model
Representation of a Document
DOM Implementation
Be Pragmatic: DHTML vs. DOM
Be Pragmatic: Use Events
Existing AJAX Frameworks for ASP.NET
ASP.NET Script Callbacks
The AJAX.NET Professional Library
The Anthem.NET Framework
The ComfortASP.NET Framework
The Telerik r.a.d.controls for ASP.NET Framework
The ComponentArt Web.UI Framework
Infragistics’s NetAdvantage for ASP.NET AJAX
Categorizing AJAX Frameworks
ASP.NET AJAX in Person
Setting Up ASP.NET AJAX Extensions
Installing ASP.NET AJAX Extensions
Deploying ASP.NET AJAX Applications
Core Components
The Microsoft Client Library for AJAX
Server-Based Components
The JSON Infrastructure
Conclusion
2. The Microsoft Client Library for AJAX
JavaScript Language Extensions
Infrastructure for Extensions
The Microsoft AJAX Library Engine
The Root Object of the Microsoft AJAX Library
Other Top-Level Types
Discovering Type Information
Reflection Capabilities
The $get Alias
Closures vs. Prototypes
Object-Oriented Extensions
Adding Namespace Support
Adding Inheritance Support
Adding Interface Support
Core Components
The Sys.Application Object
Generalities of the Sys._Application Class
Looking Up Components
Events in the Page Lifetime
The Sys.Component Object
The Sys.Component Class
Detecting Property Changes
Batched Updates
The $create Alias
Component Disposing
The Network Stack
The Sys.Net.WebRequest Class
The XML HTTP Executor
The Sys.WebForms.PageRequestManager Class
User-Interface Components
The Sys.UI.Behavior Class
The Sys.UI.Control Class
The Sys.UI.DomElement Class
Handling DOM Events
A Cross-Browser Model for Events
Other Components and Functionalities
String Manipulation
Debugging Facilities
Conclusion
II. Adding AJAX Capabilities to a Site
3. The Pulsing Heart of ASP.NET AJAX
Configuration of ASP.NET AJAX
The web.config File
New Configuration Sections
The <scripting> Section
The <webServices> Section
The Runtime Engine
The ScriptResource HTTP Handler
The ScriptModule HTTP Module
The Script Manager Component
The ASP.NET ScriptManager Control
Properties of the ScriptManager Control
Methods of the ScriptManager Control
Events of the ScriptManager Control
The ScriptManagerProxy Control
Script Loading
Adding Script Resources
Mapping Script Paths
Resolving and Overriding Script Files
Script Globalization
Script Localization
The Script Registration Model
Script Error Handling
Handling Debug and Release Scripts
Custom Error Handling and Redirection
Conclusion
4. Partial Page Rendering
Defining Updatable Regions
Generalities of the UpdatePanel Control
The UpdatePanel Control at a Glance
The Programming Interface of the Control
Programmatic Updates
The Eventing Model of the Control
Enabling Partial Rendering
Defining the Updatable Contents
Defining Regions Programmatically
Rendering Modes
Detecting Ongoing Updates
Testing the UpdatePanel Control
A First Sample Page
Using AJAX for Multistep Operations
Using AJAX for Quicker Data Validation
Master Pages and Partial Updates
Partial Updates from User Controls
The Mechanics of Updatable Panels
Client Script Injection
Format of the AJAX Request
Detecting AJAX Requests at Runtime
Format of the AJAX Response
One Partial Update at a Time
Error Handling in Partial Updates
Taking Control of Updatable Regions
Triggering the Panel Update
Updating Modes
Conditional Refresh of an UpdatePanel Control
Programmatic Updates of Panels
Triggers of an UpdatePanel Control
Full Postbacks from Inside Updatable Panels
Triggering Periodic Partial Updates
Generalities of the Timer Control
Using the Timer
Providing User Feedback During Partial Updates
Generalities of the UpdateProgress Control
Composing the Progress Screen
Aborting a Pending Update
Associating Progress Screens with Panels
Client-Side Events for a Partial Update
Events of the Client PageRequestManager Object
Kick In before the Request Starts
Disabling Visual Elements during Updates
Managing Progress Screens
Page Loading Events
Passing Data Items during Partial Updates
Motivation for Using Data Items
Preparing Data Items
Data Items as JSON Strings
Retrieving Data Items on the Client
Animating Panels during Partial Updates
Visual Feedback during the Partial Update
Visual Feedback after the Page Refresh
Conclusion
5. The AJAX Control Toolkit
Extender Controls
What Is an Extender, Anyway?
Formalizing the Concept of a “Behavior”
Examining a Sample Extender
Target Properties
The ExtenderControl Class
Generalities of Extender Controls
The IExtenderControl Interface
Creating a Sample Extender
The FocusExtender Control
Defining the Client Behavior
The Extender’s Client Object Model
Using the Focus Extender Control
Introducing the AJAX Control Toolkit
Get Ready for the Toolkit
The ACT Project
Adding ACT Components to the Toolbox
Registering ACT Components with the Page
What’s in the AJAX Control Toolkit
Extenders in the ACT
Controls in the ACT
The Accordion Control
Generalities of the Accordion Control
Properties of the Control
Animating the Control
Sizing the Control
Using the Accordion Control
The Accordion Control in Action
Accordion Panes
The Rating Control
Generalities of the Rating Control
Properties of the Control
Styling the Control
Using the Rating Control
The Rating Control in Action
The Eventing Model
The ReorderList Control
Generalities of the ReorderList Control
Properties of the Control
Events of the Control
Using the ReorderList Control
Configuring the ReorderList Control
Reordering and Postback Events
Persisting Reordered Items
The TabContainer Control
Generalities of the TabContainer Control
Properties of the Control
Properties of Tab Panels
Using the TabContainer Control
Configuring the TabContainer Control
Changing the Selected Tab
The Client-Side Object Model
AJAX Control Toolkit Extenders
Panel Extenders
The CollapsiblePanel Extender
The DragPanel Extender
The DropDown Extender
Button Extenders
The ConfirmButton Extender
The MutuallyExclusiveCheckBox Extender
The ToggleButton Extender
Pop-up Extenders
The HoverMenu Extender
The ModalPopup Extender
The PopupControl Extender
User-Interface Extenders
The AlwaysVisibleControl Extender
The CascadingDropDown Extender
The DropShadow Extender
The DynamicPopulate Extender
The PagingBulletedList Extender
The ResizableControl Extender
The RoundedCorners Extender
Input Extenders
The AutoComplete Extender
The Calendar Extender
The FilteredTextBox Extender
The MaskedEdit Extender
The NoBot Extender
The NumericUpDown Extender
The PasswordStrength Extender
The Slider Extender
The TextBoxWatermark Extender
The ValidatorCallout Extender
Animation Extenders
The Animation Extender
The UpdatePanelAnimation Extender
Conclusion
III. Client-Centric Development
6. Built-in Application Services
Forms Authentication Services
The System Infrastructure for Authentication
The Client-Side Authentication Service Class
The Server-Side Authentication Web Service
The Programming Interface of the Service
Configuration of the Authentication Service
Using the Authentication Service in an Application
The Login Process
The Logout Process
Typical User Interface Enhancements
Design Guidelines for Protected Resources
User Profiling Services
The System Infrastructure for Profiling
The Client-Side Profiling Service Class
The Server-Side Profiling Web Service
The Programming Interface of the Service
Configuration of the Profiling Service
Using the Profile Service in an Application
Initializing a Profile-Enabled Page
Loading the User Profile
Updating the Profile
Conclusion
7. Remote Method Calls with ASP.NET AJAX
Designing the Server API for Remote Calls
Defining the Contract of the Remote API
The Contracted Interface
What’s Coming Out with “Orcas”?
Why Not WSDL and SOAP?
Implementing the Contract of the Remote API
Contract via Web Services
Contract via Code-Behind Classes
Publishing the Contract
Remote Calls via Web Services
Creating an AJAX Web Service
The ScriptService Attribute
The ScriptMethod Attribute
Registering AJAX Web Services
Configuring ASP.NET Applications to Host AJAX Web Services
Consuming AJAX Web Services
The Proxy Class
Executing Remote Calls
Error Handling
Giving User Feedback
Handling Timeouts
Considerations for AJAX Web Services
Why Local Web Services?
Why JSON-Based Web Services?
Runtime Support for JSON-Based Web Services
Why Not WCF Services?
Remote Calls via Page Methods
Creating Page Methods
Defining Page Methods
Enabling Page Methods
Runtime Support for Page Methods
Why No Page Life Cycle?
Consuming Page Methods
The Proxy Class
Executing Page Methods
Page Methods vs. AJAX Web Services
Bridging External Web Services
Traditional Server-to-Server Approach
Using .NET Proxies
Using Plain Web Requests
ASP.NET AJAX Futures Bridge Files
Configuration and Setup
The Bridge File
Building a Bridge File for the Amazon Web Service
Consuming Amazon Data through a Bridge
Transforming the Web Service Response
Conclusion
8. Building AJAX Applications with ASP.NET
AJAX in Perspective
The Benefits of AJAX
AJAX Is a Real Breakthrough
The Continuous Feel
The User’s Experience and User Interface
The Downsides of AJAX
Comparing AJAX to Other Rich Clients
Not Ready for Miracles as Yet
Continuous Connection
One-Page Application
Patterns, Practices, and Services
Services and Web Services
REST vs. SOAP
REST in ASP.NET AJAX
Quick Tour of AJAX Patterns
Revisiting ASP.NET Starter Kits
The Jobs Site Starter Kit at a Glance
Overview of JSSK
Setting up for AJAX
Reducing Page Flickering
Adding the Script Manager
Adjusting the Log-in Process
Refactoring the Log-in Process
Users Registration
Searching for Jobs
Posting a Resume
Controlling Menus and Navigation
Periodic Screen Refresh
Refreshing on Postback
Using Updatable Panels
Using Server-Side Services
Using Server Timers
Using Client Timers
Applying the Timeout Pattern
Conclusion
About the Author
Additional Resources for Developers: Advanced Topics and Best Practices
Additional Resources for C# Developers
Additional SQL Server Resources for Developers
Additional Resources for Web Developers
Additional Resources for Developers
Visual Basic 2005
Visual C# 2005
Web Development
Data Access
SQL Server 2005
Other Developer Topics
More Great Developer Resources
Developer Step by Step
Developer Reference
Advanced Topics
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Introduction
Next
Next Chapter
1. The AJAX Revolution
Part I. ASP.NET AJAX Building Blocks
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset