Presentation is loading. Please wait.

Presentation is loading. Please wait.

AJAX Development Mike Ormond Developer & Platform Group Microsoft Ltd

Similar presentations


Presentation on theme: "AJAX Development Mike Ormond Developer & Platform Group Microsoft Ltd"— Presentation transcript:

1 AJAX Development Mike Ormond Developer & Platform Group Microsoft Ltd mike.ormond@microsoft.com http://blogs.msdn.com/mikeormond

2 Communication (XMLHttpRequest) Asynchronous Client side processing DHTML JavaScript Data Exchange Format (JSON, HTML etc) XML What is AJAX?

3 XmlHttpRequest (XHR) var req; function loadXMLDoc(url) { req = false; // branch for native XMLHttpRequest object if(window.XMLHttpRequest && !(window.ActiveXObject)) { try { req = new XMLHttpRequest(); } catch(e) { req = false; } // branch for IE/Windows ActiveX version } else if(window.ActiveXObject) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { req = false; } if(req) { req.onreadystatechange = processReqChange; req.open("GET", url, true); req.send(""); } function processReqChange() { // only if req shows "loaded" if (req.readyState == 4) { // only if "OK" if (req.status == 200) { //...processing statements go here... } else { alert("There was a problem retrieving the XML data:\n“ + req.statusText); } From: http://developer.apple.com/internet/webcontent/xmlhttpreq.html

4 ASP.NET AJAX Architecture Client Components Server Components

5 The AJAX Extensions Client Components Client Components Server Components Server Components ASP.NET AJAX Extensions ASP.NET 2.0 Server Controls Extender Control Framework Networking and Services Integration

6 Server Controls UpdatePanel UpdateProgress ScriptManager ScriptManagerProxy Timer

7 ASP.NET AJAX Extensions Server Controls

8 UpdatePanel <asp:UpdatePanel runat="server" UpdateMode="Always | Conditional" ChildrenAsTriggers="false | true" RenderMode="Block | Inline ">

9 UpdateProgress <asp:UpdateProgress runat="server" AssociatedUpdatePanelID="u1" DisplayAfter="500" DynamicLayout="true | false" > <asp:Timer runat="server" Enabled="true | false" Interval="500" OnTick="Handler" /> Timer

10 ScriptManager <asp:ScriptManager runat="server" AllowCustomErrorsRedirect="true | false" AsyncPostBackErrorMessage="Some Error Message" AsyncPostBackTimeout="500" EnablePageMethods="true | false" EnablePartialRendering="true | false“ LoadScriptsBeforeUI="true | false" ScriptMode="Auto | Debug | Inherit | Release"

11 UpdatePanel Under the Covers Client script processes “delta” response Updates rendering with new markup Server processes a regular post-back Same page lifecycle, post-back processing Only render content of UpdatePanels needing update Client script suppresses normal form submit Simulates post-back via XMLHttpRequest All form fields, including view state

12 Script Core Core Script Framework Classes and interfaces Inheritance Virtual methods Multi-cast event handlers similar to.NET Enumerations Abstract methods Base Class Library StringbuilderSerializer Debugging & Tracing Networking Browser Compatibility Safari Firefox Opera IE

13 Working With Types Use methods on the ‘Type’ Class Type.registerNamespace Type.registerClass Type.registerInterface

14 Extender Control Framework Enhance ASP.NET controls with client behaviors Add to aspx to control the client behavior of a server control Handle events from browser DOM using a behavior Creating Extenders Create JavaScript File for client behavior Either –Inherit the ExtenderControl Abstract Class –Implement the IExtenderControl interface

15 Control Toolkit Client Components Client Components Server Components Server Components ASP.NET AJAX Extensions ASP.NET 2.0 ASP.NET AJAX Control Toolkit Controls Extenders

16 Extender Controls

17 Server ASMX Requirements Reference Microsoft.Web.Script.Services [ScriptService] Attribute on Class Add [WebMethod] Attribute to Method Web Service Networking and Services Authentication Service Profile Service ASP.NET Application Services ASPX Page Method

18 Calling Services

19 Other Host There’s More… ASP.NET Futures CTP Microsoft AJAX Library Client Components Client Components Server Components Server Components ASP.NET AJAX Extensions ASP.NET 2.0 ASP.NET AJAX Control Toolkit Controls Extenders

20 Visual Studio 2008 (Orcas) Mike Ormond Developer & Platform Group Microsoft Ltd mike.ormond@microsoft.com http://blogs.msdn.com/mikeormond

21 Orcas Multi- Targeting Support CSS SupportData AJAX & JavaScript Support

22 Orcas

23 © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.


Download ppt "AJAX Development Mike Ormond Developer & Platform Group Microsoft Ltd"

Similar presentations


Ads by Google