You are on page 1of 14

Programming MS AJAX with

PHP

Joe Stagner
Microsoft Corporation
Joe.Stagner@Microsoft.com
http://www.JoeOn.net
February 9, 2008 Hyatt Regency Chicago, Illinois
ASP.NET AJAX Architecture

Client Server
Server-generated ASP.NET 2.0 ASP.NET Web
XHTML/CSS
Proxy Scripts AJAX-enabled pages Services (ASMX)

Microsoft AJAX Library ASP.NET 2.0 AJAX Extensions

Components Application
Services Bridge
ASP.NET AJAX
Browser Compatibility Server Controls
Web Services
Bridge
Networking

ASP.NET 2.0
Core Services
Page
Application
Framework and
Services
Server Controls
Browsers (Internet Explorer, Firefox, Safari, others)
AJAX Library Design Goals

A framework for
OOP in JavaScript

.NET-like APIs on core script
objects such as extensions and
Type
Classes to encapsulate data and
logic, and easily associate
with HTML elements

Abstract browser inconsistencies to
provide a consistent API

Easy and seamless interaction
with Web services
Client-Centric Web Service Usage

Client’s Browser ASP.NET 2.0 with AJAX
Web Extensions 1.0
Presentation Service Initial page access MS AJAX
ASP.NET
(HTML/CSS) Proxy Library /
HTML and linked content Page
DOM Injection CSS files
sent down, including js proxy

Deserialized Web method call
JS Client ASMX
JSON
Control Asynchronous response Service
as JSON data
Calling Web Services with the Microsoft AJAX Library
Tracing and Debugging

Use trace utility to capture HTTP traffic
Enable debugging in your browser

Use the Visual Studio debugger

Use Sys.Debug class and functions

Use external tools in other browsers
Tracing and Debugging
Localization & Globalization

Three localization
models
Localized resource
types each in their Use central storage
own .js file with ScriptManager

Date globalization Postback not
with the localeFormat required after
method culture value set
Cross Browser & Cross Server

• Completely implemented in JavaScript
• Does not require ASP.NET
• Does not require any browser add-ins
• Works natively on popular browsers
– Internet Explorer
– Firefox
– Opera
– …
• Supporting libraries available
– e.g. PHP for Microsoft AJAX Library
Using the Microsoft AJAX Library with alternate
browsers and servers
ASP.NET AJAX Futures

• Preview of New Features in Development
• MSI contains Client and Server Additions
• Simple and Complex Databinding
• Drag-drop, Web parts, Animations
Session Summary

• OO, .NET-Like JavaScript Framework
• Excellent Tracing and Debugging Support
• Extensive Localization and Globalization
Resources

• ASP.NET AJAX
http://ajax.asp.net
• PHP for Microsoft AJAX Library
http://www.codeplex.com/phpmsajax
• Find Me
– Joe.Stagner@Microsoft.com
– www.JoeOn.net
– www.ASP.net