Presentation is loading. Please wait.

Presentation is loading. Please wait.

Random Logic l Forum.NET l 20061 AJAX Behind the buzz word Forum.NET ● January 23, 2006.

Similar presentations


Presentation on theme: "Random Logic l Forum.NET l 20061 AJAX Behind the buzz word Forum.NET ● January 23, 2006."— Presentation transcript:

1 Random Logic l Forum.NET l 20061 AJAX Behind the buzz word Forum.NET ● January 23, 2006

2 Random Logic l Forum.NET l 20062 What is Ajax? - Not a technology but a methodology. - A set of technologies being used together in a particular way.

3 Random Logic l Forum.NET l 20063 AJAX Which stands for  Asynchronous JavaScript and XML which is itself short for...  Asynchronous JavaScript  XHTML  DOM  CSS  XMLHTTPRequest

4 Random Logic l Forum.NET l 20064 AJAX: From another view  standards-based presentation using XHTML and CSS;  dynamic display and interaction using the Document Object Model;  data interchange and manipulation using XML and XSLT;  asynchronous data retrieval using XMLHttpRequest;  and JavaScript binding everything together.

5 Random Logic l Forum.NET l 20065 Is it new? Not really -Hidden frames -Good old JavaScript

6 Random Logic l Forum.NET l 20066 So where did it come from? Adaptive Path >> Jesse James Garrett  Q. Why did you feel the need to give this a name?  A. I needed something shorter than “Asynchronous JavaScript+CSS+DOM+XMLHttpReques t” to use when discussing this approach with clients.

7 Random Logic l Forum.NET l 20067 Traditional Web Application Client CSS HTML HTML GET HTML POST DatabaseServer

8 Random Logic l Forum.NET l 20068 Traditional Web Application

9 Random Logic l Forum.NET l 20069 Breaking the stop start paradigm

10 Random Logic l Forum.NET l 200610 AJAX the new generation

11 Random Logic l Forum.NET l 200611 AJAX Web Application Client HTML / XHTML XML Data CSS XSL DOM XML HTTP DatabaseServer  Controller spans the network  Standards based rich internet applications

12 Random Logic l Forum.NET l 200612

13 Random Logic l Forum.NET l 200613 Why is it popular?  Google helped popularize it in GMail  Increase Usability of Web Applications  Rich Internet Applications without Flash  Save Bandwidth  Download only data you need  Faster interfaces (sometimes)  Solves User Frustration

14 Random Logic l Forum.NET l 200614 Why is it bad?  Breaks back button support  URL's don't change as state changes  Cross Browser Issues can be a pain  Using Ajax for the sake of Ajax  Can't access domains other than the calling domain  May be disabled (for security reasons) or not available on some browsers  Debugging

15 Random Logic l Forum.NET l 200615 Browser support  Browsers that support Ajax  Apple Safari 1.2 and above  Konqueror  Microsoft Internet Explorer 4.0 and above  Mozilla Firefox 1.0 and above  Netscape 7.1 and above  Opera 7.6 and above

16 Random Logic l Forum.NET l 200616 AJAX in the real world

17 Random Logic l Forum.NET l 200617 Examples of AJAX  GMail  Google Maps Google Maps  Google Suggest Google Suggest  NetVibes NetVibes

18 Random Logic l Forum.NET l 200618 XMLHttpRequest  A JavaScript Class that lets you make asynchronous HTTP requests from JavaScript  Make an HTTP request from a JavaScript event  A call back JavaScript function is invoked at each state of the HTTP request and response  Native XMLHttpRequest support should be in IE7

19 Random Logic l Forum.NET l 200619 XMLHttpRequest Properties  onreadystatechange - call back function for state changes  readyState - the current state of the HTTP call  responseText - the text result of the request  responseXML - DOM xml object from the request  status - HTTP status code of the response  statusText - HTTP status text

20 Random Logic l Forum.NET l 200620

21 Random Logic l Forum.NET l 200621 A simple example XML file

22 Random Logic l Forum.NET l 200622 Ajax.NET – How it works  Add reference ajax.dll to your project  Modify your web.config to configure IHttpHandler for Ajax.NET requests  Write your methods in C#/VB.NET and add the attribute [AjaxMethod]  Call Class1.Method1(param1, param2, callback, context); from client-side JavaScript

23 Random Logic l Forum.NET l 200623 Demo AJAX.NET

24 Random Logic l Forum.NET l 200624 Ajax.NET – Key Benefits  Methods only get attribute, no need to implement interface or inherit from class [AjaxMethod] public int GetAge(string username){…}  Source-code doesn‘t change if you want to use the method in server-side code DemoMethods dm = new DemoMethods(); int age = dm.GetAge(“michael“);

25 Random Logic l Forum.NET l 200625 Ajax.NET – Key Benefits  Client-side JavaScript will get “real“ objects from Ajax.NET calls using JSON function test_callback(res) { alert(res.value.FirstName + ‘ ‘ + res.value.FamilyName); }  DataSet, DataTable, DataRow, ArrayList, Array, DateTime, TimeSpan, …  Create your own IAjaxObjectConverters

26 Random Logic l Forum.NET l 200626 Ajax.NET – Key Benefits  Cache requests (CacheDurationTimeSpan)  Access SessionState objects using HttpContext.Current.Session[…]  Unicode support without use of XML parser  Use Ajax.NET to retreive “events“ instead of polling

27 Random Logic l Forum.NET l 200627 Conclusion  AJAX enable more interactive, more responsive, and smarter Web applications.  AJAX is not tied to a particular programming language.  Remember AJAX has its cons use it wisely.

28 Random Logic l Forum.NET l 200628 Questions?

29 Random Logic l Forum.NET l 200629 Thank You


Download ppt "Random Logic l Forum.NET l 20061 AJAX Behind the buzz word Forum.NET ● January 23, 2006."

Similar presentations


Ads by Google