SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Creating Rich Client Web Applications 
with AJAX
Agenda 
• Web Apps: Whats good, whats not 
• What is AJAX and how can AJAX help with the 
bad? 
• Creating simple AJAX applications 
• AJAX endpoints and payloads 
• Using third-party AJAX libraries 
• AJAX security 
• ASP.NET 2.0 client callbacks and Atlas
The Good, Bad and Ugly 
(of Web Applications) Condensed Version 
• The Good 
– Centralized control of the application 
– Easy deployment 
• The Bad 
– Locked into the browser sandbox 
– Loose the “thick-client” experience 
– One way to get data – the browser postback 
• The Ugly 
– Browser compatibility
How does AJAX help? 
• Keep all of the good of thin client 
• Bring the “thick-client” experience much closer to 
the thin client 
• Escape the standard client/server HTTP request 
communications paradigm (the “postback”)
What the heck is AJAX? 
• Asynchronous JavaScript And XML 
– No new technologies here, just a new name 
• Takes advantage of modern uplevel browser features: 
– A client side XML parser 
(on Windows this is generally the Microsoft XML parser) 
• Send data to/receive data from the server outside of the browsers standard 
communications mechanism (eg the postback) 
• Parse and enumerate XML formatted data on the client 
– A rich Document Object Model (DOM) 
• Powerful interaction points between the different elements of your 
webpage, the browser and browser plugins
The standard web client/server 
request processing model 
HTTP/1.1 200 OK 
Date: Fri, 04 Nov 2005 17:17:37 GMT 
Server: Microsoft-IIS/6.0 
P3P: CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV 
ONL PHY PRE PUR UNI" 
X-Powered-By: ASP.NET 
X-AspNet-Version: 2.0.50727 
Cache-Control: private 
Content-Type: text/html; charset=utf-8 
Content-Length: 22370 
GET / HTTP/1.1 
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, 
application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* 
Accept-Language: en-us 
Accept-Encoding: gzip, deflate 
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 
2.0.50727) 
Host: www.microsoft.com 
Proxy-Connection: Keep-Alive 
Cookie: MC1=GUID=5cd2d5ca1a1cc54183c10f4bacaa45fa&HASH=cad5&LV=20059&V=3; 
A=I&I=AxUFAAAAAABuCAAAzJInmvNBZzRHm8aAr99x0A!!; msresearch=1 
Browser makes a resource 
request to the server 
<html dir="ltr" lang="en"> 
<head> 
<META http-equiv="Content-Type" content="text/html; charset=utf-8" > 
<!--TOOLBAR_EXEMPT--> 
<meta http-equiv="PICS-Label" content="(PICS-1.1 &quot;http://www.rsac.org/ratingsv01.html&quot; l gen true r (n 0 s 0 v 
0 l 0))" > 
<meta name="KEYWORDS" content="products; headlines; downloads; news; Web site; what's new; solutions; services; 
software; contests; corporate news;" > 
<meta name="DESCRIPTION" content="The entry page to Microsoft's Web site. Find software, solutions, answers, 
support, and Microsoft news." > 
<meta name="MS.LOCALE" content="EN-US" > 
<meta name="CATEGORY" content="home page" > 
<title>Microsoft Corporation</title> 
<base href="http://g.msn.com/mh_mshp/98765" > 
<style type="text/css" media="all"> 
Server processes the request 
and returns a result to the 
browser 
HTTP Request 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > 
HTTP Response
Demo 
• A simple HTML postback example
Problems with this model 
• To get any data requires complete round trip to the 
server which is inefficient 
• UI suffers because the entire UI must be refreshed 
as part of the postback, even if it does not change 
(users see the page “flash”) 
• User is blocked from continuing to work until the 
page is returned from the postback
The client/server request 
processing model using AJAX 
GET /AjaxPresentation/AjaxWithHandler/SimpleAjax.ashx?DataRequest=true&val1=2&val2=2 HTTP/1.1 
Accept: */* 
Accept-Language: en-us 
Referer: http://localhost/AjaxPresentation/AjaxWithHandler/SimpleAjax.aspx 
Accept-Encoding: gzip, deflate 
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727) 
Host: localhost 
Proxy-Connection: Keep-Alive 
Cookie: .ASPXANONYMOUS=AcYSqWXDsOAzMTgxM2IwZi04YzdiLTQyMWMtYjJiNi0yYWVmNDA5OGY0Njg1; 
ASP.NET_SessionId=rq0avnqjfi5eer45zeq0qdj1 
Server processes the 
request and returns a 
result to the browser 
Browser makes a 
resource request to 
the server 
HTTP Request 
Using XMLHTTP object, an async 
HTTP request is made to the server 
JavaScript callback function 
handles XMLHTTP response 
HTTP Response 
HTTP/1.1 200 OK 
Server: Microsoft-IIS/5.1 
Date: Fri, 04 Nov 2005 17:33:53 GMT 
X-Powered-By: ASP.NET 
X-AspNet-Version: 1.1.4322 
Cache-Control: private 
Content-Type: text/html; charset=utf-8 
Content-Length: 1 
4
AJAX Advantages 
• Send an receive only the data you need 
– Think chatty, not chunky 
• Only update portions of the page that need to be 
updated 
• Asynchronous, so users can continue to work while 
the page is updated, and more data is fetched
Creating Ajax applications 
• Use JavaScript to instantiate the XML parser 
//Works in Mozilla (Firefox) and Safari 
var oXml = new XMLHttpRequest(); 
Works in Internet Explorer 
var oXml = new ActiveXObject("Microsoft.XMLHTTP"); 
• Use the XML object to create a new HTTP request to 
the server: 
oXml.Open("GET", “Endpoint.aspx”, true); 
• Use the XML objects onreadystatechange property to 
assign a client-side callback method
Demo 
• A simple AJAX demo
Side note: Debugging Client Script 
via Internet Explorer 
– Enable script 
debugging 
– Display script error 
notifications 
– Add the “debugger” 
command to your script 
• Mozilla supports 
debugging via 
Venkman debugger 
add-in
AJAX Endpoints 
• Anything that can be accessed via HTTP can serve as 
an AJAX endpoint 
– Standard ASP.NET webpages (*.aspx) 
– HTTP Handlers (*.ashx, or custom extenstions) 
– Web Services (*.asmx) 
– PHP Web Pages 
• Think about endpoint performance 
– ASPX endpoints require a complete page lifecycle to 
execute on each request 
– Handlers and Web Services are much more lightweight 
– Both can access Session, Cache etc
Demo 
• Using Handlers as AJAX endpoints 
• Accessing Session from an Handler
Controlling Asynchronous 
Communications 
• Create timer based operations using JavaScripts 
setInterval command 
• Make sure you control the number of open HTTP 
connections, as well as the polling interval
Demo 
• Adding AJAX Asynchronous polling
AJAX Payloads 
• The AJAX “Payload” is the data returned by the 
HTTP request. 
• Since Ajax is simply a standard HTTP 
request/response, the response payload can be 
anything you like 
• Examples: 
– XML, HTML, Simple Types (number, string), JSON 
• Remember that the actual HTTP payload will always 
be a type of string, so objects must be serialized
Primary Payload Types 
• Two primary types of payloads in AJAX: 
– XML 
• Simple, easy to read format, but you generally must use the MS 
XML Parser and DOM to work with it 
• Native to .NET – easy to create on and transport from the server 
– JSON (JavaScript Object Notation) 
• Slightly more complex 
• Data must be massaged into JSON format 
• Easier to work with once its on the client 
• Either supports complex object serialization
Using XML Payloads 
• Use the XML DOM to examine and manipulate XML 
data on the client 
– ResponseXml property automatically provides a representation 
of data as parsed by the MSXML XMLDOM parser 
– XMLDOM provides complete XML navigation concepts: 
Document, Element, Node 
– Use client side XSLT to transform or format data 
– ParseError object tells you if the returned XML was badly 
formed 
//Works in Mozilla (Firefox) and Safari 
var oXsl = new XSLTProcessor(); 
//Works in Internet Explorer 
var oXsl = new ActiveXObject("MSXML2.DOMDocument");
Demo 
• Parsing AJAX XML payloads 
• Using XSLT with AJAX Payloads
JSON 
• JSON (JavaScript Object Notation) is a lightweight 
data-interchange format. 
• It is easy for humans to read and write. 
• It is easy for machines to parse and generate. 
• Useful as a data-interchange because it can be 
trivially parsed by JavaScript's built in eval() 
procedure. 
var json_data; 
json_data = ""The quick brown fox.""; 
myObject = eval("return " + json_data);
Examples of JSON 
• Object serialized to JSON example 
{"menu": { 
"id": "file", 
"value": "File", 
"popup": { 
"menuitem": [ 
{"value": "New", "onclick": "CreateNewDoc()"}, 
{"value": "Open", "onclick": "OpenDoc()"}, 
{"value": "Close", "onclick": "CloseDoc()"} 
] 
} 
}} 
• The same text expressed as XML: 
<menu id="file" value="File"> 
<popup> 
<menuitem value="New" onclick="CreateNewDoc()" /> 
<menuitem value="Open" onclick="OpenDoc()" /> 
<menuitem value="Close" onclick="CloseDoc()" /> 
</popup> 
</menu>
Other AJAX libraries 
• Server Side Libraries 
– Ajax.NET 
http://ajax.schwarz-interactive.de/csharpsample/default.aspx 
– PHP & ASP 
http://cpaint.sourceforge.net/ 
• Client Side Libraries 
– Google AJAXSLT 
http://goog-ajaxslt.sourceforge.net/ 
– Dojo 
http://dojotoolkit.org/
Ajax.NET 
• Open Source AJAX implementation for .NET 
(Note: while still available, the project is not longer being actively developed) 
• Easy to use. Requires a simple method attribute ( 
[AjaxMethod()]) to expose server side methods as AJAX 
endpoints 
• Automatically uses JSON to transport complex objects like 
DataSets 
• Uses dynamically generated JavaScript to create client side 
proxies for server side objects 
• Supports transport of integers, strings, doubles, booleans, 
DateTime, DataSets, DataTables and primitive types of custom 
classes and arrays 
• Other types supported via Custom Type converters
Demo 
• Using Ajax.NET
AJAX Security 
• HTTPS is your friend 
• Keep sensitive code or data on the server where you 
can control it 
• By default everything is sent clear text over the wire 
(including client side code), and could potentially be 
captured in transit and modified 
• JavaScript has no intrinsic over-the-wire encryption 
support, but you can implement your own encryption 
(search Google for ‘AJAX encryption’)
Client Callbacks 
• New Feature in ASP.NET 2.0 
• Add client-side callbacks to your web pages or server 
controls 
• Executes in the context of the current page 
– Allows you to access existing control state on the server 
during the callback process 
– Keeps you from having to pass as much data back 
• Not as flexible in setting endpoints, and passing 
arguments
Atlas 
• Microsofts next generation AJAX framework 
– Cross browser compatible 
• Includes both declarative and imperative programming 
models 
– Code in vanilla JavaScript, or use the Atlas “tag” 
programming model 
• Attempts to bring JavaScript to a first class language 
– Uses abstraction layers to add familiar programming 
constructs like Types, Enumerations, Class Inheritance 
– Also uses abstraction layers to abstract cross browser 
problems 
• Includes a number of controls for common functionality
Declarative Atlas 
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005" xmlns:wiki="wiki"> 
<components> 
<label targetElement="loadingMsg1"> 
<bindings> 
<binding dataContext="documentsSource1" dataPath="isReady" property="visible" transform="Invert"/> 
</bindings> 
</label> 
<textBox targetElement="<%= navCategoryID.ClientID %>" /> 
<textBox targetElement="<%= navDefaultDocumentTitle.ClientID %>"/> 
<textBox targetElement="recurseSubfolders1"/> 
<dataSource id="documentsSource1" serviceURL="<%= ResolveUrl("~/WebServices/DocumentWebService.asmx") %>"> 
<bindings> 
<binding dataContext="<%= navCategoryID.ClientID %>" dataPath="text" property="selectParameters" propertyKey="categoryID"/> 
<binding dataContext="<%= navDefaultDocumentTitle.ClientID %>" dataPath="text" property="selectParameters“ 
propertyKey="defaultDocumentTitle"/> 
<binding dataContext="recurseSubfolders1" dataPath="text" property="selectParameters" propertyKey="strRecurseSubfolders"/> 
</bindings> 
</dataSource>

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Jquery Ajax
Jquery AjaxJquery Ajax
Jquery Ajax
 
Learn Ajax here
Learn Ajax hereLearn Ajax here
Learn Ajax here
 
Ajax and PHP
Ajax and PHPAjax and PHP
Ajax and PHP
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
 
ASP.NET WEB API Training
ASP.NET WEB API TrainingASP.NET WEB API Training
ASP.NET WEB API Training
 
Krug Fat Client
Krug Fat ClientKrug Fat Client
Krug Fat Client
 
Ajax presentation
Ajax presentationAjax presentation
Ajax presentation
 
Interoperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITInteroperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSIT
 
Introduction to ajax
Introduction  to  ajaxIntroduction  to  ajax
Introduction to ajax
 
Copy of ajax tutorial
Copy of ajax tutorialCopy of ajax tutorial
Copy of ajax tutorial
 
PHP - Introduction to PHP AJAX
PHP -  Introduction to PHP AJAXPHP -  Introduction to PHP AJAX
PHP - Introduction to PHP AJAX
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
AJAX - An introduction
AJAX - An introductionAJAX - An introduction
AJAX - An introduction
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
 
Ajax
AjaxAjax
Ajax
 
Ajax
AjaxAjax
Ajax
 
HTML5 - An introduction
HTML5 - An introductionHTML5 - An introduction
HTML5 - An introduction
 
Excellent rest using asp.net web api
Excellent rest using asp.net web apiExcellent rest using asp.net web api
Excellent rest using asp.net web api
 
Tips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC ApplicationsTips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC Applications
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
 

Andere mochten auch

SynapseIndia mobile apps deployment framework internal architecture
SynapseIndia mobile apps deployment framework internal architectureSynapseIndia mobile apps deployment framework internal architecture
SynapseIndia mobile apps deployment framework internal architectureSynapseindiappsdevelopment
 
SynapseIndia dotnet web applications development
SynapseIndia  dotnet web applications developmentSynapseIndia  dotnet web applications development
SynapseIndia dotnet web applications developmentSynapseindiappsdevelopment
 
Synapse india fundamentals of dotnet development
Synapse india fundamentals of dotnet  developmentSynapse india fundamentals of dotnet  development
Synapse india fundamentals of dotnet developmentSynapseindiappsdevelopment
 
SynapseIndia drupal presentation on drupal info
SynapseIndia drupal  presentation on drupal infoSynapseIndia drupal  presentation on drupal info
SynapseIndia drupal presentation on drupal infoSynapseindiappsdevelopment
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorialSynapseindiappsdevelopment
 

Andere mochten auch (15)

Initializing arrays
Initializing arraysInitializing arrays
Initializing arrays
 
Synapse india basic php development part 1
Synapse india basic php development part 1Synapse india basic php development part 1
Synapse india basic php development part 1
 
SynapseIndia mobile apps
SynapseIndia mobile appsSynapseIndia mobile apps
SynapseIndia mobile apps
 
Synapseindia android apps (operating system)
Synapseindia android apps (operating system)Synapseindia android apps (operating system)
Synapseindia android apps (operating system)
 
SynapseIndia mobile apps deployment framework internal architecture
SynapseIndia mobile apps deployment framework internal architectureSynapseIndia mobile apps deployment framework internal architecture
SynapseIndia mobile apps deployment framework internal architecture
 
SynapseIndia dotnet web applications development
SynapseIndia  dotnet web applications developmentSynapseIndia  dotnet web applications development
SynapseIndia dotnet web applications development
 
Synapse india fundamentals of dotnet development
Synapse india fundamentals of dotnet  developmentSynapse india fundamentals of dotnet  development
Synapse india fundamentals of dotnet development
 
Synapse india mobile apps part1
Synapse india  mobile apps part1Synapse india  mobile apps part1
Synapse india mobile apps part1
 
Synapseindia reviews
Synapseindia reviewsSynapseindia reviews
Synapseindia reviews
 
Synapse india dotnet development web approch
Synapse india dotnet development web approchSynapse india dotnet development web approch
Synapse india dotnet development web approch
 
C compiler-ide
C compiler-ideC compiler-ide
C compiler-ide
 
SynapseIndia drupal presentation on drupal info
SynapseIndia drupal  presentation on drupal infoSynapseIndia drupal  presentation on drupal info
SynapseIndia drupal presentation on drupal info
 
Synapseindia framework for E Commerce
Synapseindia framework for E CommerceSynapseindia framework for E Commerce
Synapseindia framework for E Commerce
 
SynapseIndia dotnet development panel control
SynapseIndia dotnet development panel controlSynapseIndia dotnet development panel control
SynapseIndia dotnet development panel control
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorial
 

Ähnlich wie Synapseindia dot net development web applications with ajax

nodejs_at_a_glance.ppt
nodejs_at_a_glance.pptnodejs_at_a_glance.ppt
nodejs_at_a_glance.pptWalaSidhom1
 
Ajax tutorial by bally chohan
Ajax tutorial by bally chohanAjax tutorial by bally chohan
Ajax tutorial by bally chohanWebVineet
 
Webservices
WebservicesWebservices
Webservicess4al_com
 
Internet Explorer 8
Internet Explorer 8Internet Explorer 8
Internet Explorer 8David Chou
 
AJAX
AJAXAJAX
AJAXARJUN
 
Unit-5.pptx
Unit-5.pptxUnit-5.pptx
Unit-5.pptxitzkuu01
 
Ajax Introduction
Ajax IntroductionAjax Introduction
Ajax IntroductionOliver Cai
 
Cape Cod Web Technology Meetup - 2
Cape Cod Web Technology Meetup - 2Cape Cod Web Technology Meetup - 2
Cape Cod Web Technology Meetup - 2Asher Martin
 
SynapseIndia dotnet development ajax client library
SynapseIndia dotnet development ajax client librarySynapseIndia dotnet development ajax client library
SynapseIndia dotnet development ajax client librarySynapseindiappsdevelopment
 
Web Server and how we can design app in C#
Web Server and how we can design app  in C#Web Server and how we can design app  in C#
Web Server and how we can design app in C#caohansnnuedu
 
Using Ajax In Domino Web Applications
Using Ajax In Domino Web ApplicationsUsing Ajax In Domino Web Applications
Using Ajax In Domino Web Applicationsdominion
 
WEB TECHNOLOGY Unit-5.pptx
WEB TECHNOLOGY Unit-5.pptxWEB TECHNOLOGY Unit-5.pptx
WEB TECHNOLOGY Unit-5.pptxkarthiksmart21
 
HTML5/JavaScript Communication APIs - DPC 2014
HTML5/JavaScript Communication APIs - DPC 2014HTML5/JavaScript Communication APIs - DPC 2014
HTML5/JavaScript Communication APIs - DPC 2014Christian Wenz
 

Ähnlich wie Synapseindia dot net development web applications with ajax (20)

Ajax
AjaxAjax
Ajax
 
Introduction to AJAX
Introduction to AJAXIntroduction to AJAX
Introduction to AJAX
 
AJAX.pptx
AJAX.pptxAJAX.pptx
AJAX.pptx
 
nodejs_at_a_glance.ppt
nodejs_at_a_glance.pptnodejs_at_a_glance.ppt
nodejs_at_a_glance.ppt
 
Ajax tutorial by bally chohan
Ajax tutorial by bally chohanAjax tutorial by bally chohan
Ajax tutorial by bally chohan
 
08 ajax
08 ajax08 ajax
08 ajax
 
Webservices
WebservicesWebservices
Webservices
 
Internet Explorer 8
Internet Explorer 8Internet Explorer 8
Internet Explorer 8
 
AJAX
AJAXAJAX
AJAX
 
Unit-5.pptx
Unit-5.pptxUnit-5.pptx
Unit-5.pptx
 
Ajax Introduction
Ajax IntroductionAjax Introduction
Ajax Introduction
 
M Ramya
M RamyaM Ramya
M Ramya
 
Cape Cod Web Technology Meetup - 2
Cape Cod Web Technology Meetup - 2Cape Cod Web Technology Meetup - 2
Cape Cod Web Technology Meetup - 2
 
Ajax
AjaxAjax
Ajax
 
SynapseIndia dotnet development ajax client library
SynapseIndia dotnet development ajax client librarySynapseIndia dotnet development ajax client library
SynapseIndia dotnet development ajax client library
 
Web Server and how we can design app in C#
Web Server and how we can design app  in C#Web Server and how we can design app  in C#
Web Server and how we can design app in C#
 
Using Ajax In Domino Web Applications
Using Ajax In Domino Web ApplicationsUsing Ajax In Domino Web Applications
Using Ajax In Domino Web Applications
 
WEB TECHNOLOGY Unit-5.pptx
WEB TECHNOLOGY Unit-5.pptxWEB TECHNOLOGY Unit-5.pptx
WEB TECHNOLOGY Unit-5.pptx
 
Walther Ajax4
Walther Ajax4Walther Ajax4
Walther Ajax4
 
HTML5/JavaScript Communication APIs - DPC 2014
HTML5/JavaScript Communication APIs - DPC 2014HTML5/JavaScript Communication APIs - DPC 2014
HTML5/JavaScript Communication APIs - DPC 2014
 

Mehr von Synapseindiappsdevelopment

Synapse india elance top in demand in it skills
Synapse india elance top in demand in it skillsSynapse india elance top in demand in it skills
Synapse india elance top in demand in it skillsSynapseindiappsdevelopment
 
SynapseIndia dotnet web development architecture module
SynapseIndia dotnet web development architecture moduleSynapseIndia dotnet web development architecture module
SynapseIndia dotnet web development architecture moduleSynapseindiappsdevelopment
 
SynapseIndia dotnet development platform overview
SynapseIndia  dotnet development platform overviewSynapseIndia  dotnet development platform overview
SynapseIndia dotnet development platform overviewSynapseindiappsdevelopment
 
SynapseIndia dotnet website security development
SynapseIndia  dotnet website security developmentSynapseIndia  dotnet website security development
SynapseIndia dotnet website security developmentSynapseindiappsdevelopment
 
SynapseIndia mobile apps deployment framework architecture
SynapseIndia mobile apps deployment framework architectureSynapseIndia mobile apps deployment framework architecture
SynapseIndia mobile apps deployment framework architectureSynapseindiappsdevelopment
 
SynapseIndia dotnet client library Development
SynapseIndia dotnet client library DevelopmentSynapseIndia dotnet client library Development
SynapseIndia dotnet client library DevelopmentSynapseindiappsdevelopment
 
SynapseIndia creating asp controls programatically development
SynapseIndia creating asp controls programatically developmentSynapseIndia creating asp controls programatically development
SynapseIndia creating asp controls programatically developmentSynapseindiappsdevelopment
 
SynapseIndia drupal presentation on drupal best practices
SynapseIndia drupal  presentation on drupal best practicesSynapseIndia drupal  presentation on drupal best practices
SynapseIndia drupal presentation on drupal best practicesSynapseindiappsdevelopment
 
SynapseIndia dotnet debugging development process
SynapseIndia dotnet debugging development processSynapseIndia dotnet debugging development process
SynapseIndia dotnet debugging development processSynapseindiappsdevelopment
 

Mehr von Synapseindiappsdevelopment (20)

Synapse india elance top in demand in it skills
Synapse india elance top in demand in it skillsSynapse india elance top in demand in it skills
Synapse india elance top in demand in it skills
 
SynapseIndia dotnet web development architecture module
SynapseIndia dotnet web development architecture moduleSynapseIndia dotnet web development architecture module
SynapseIndia dotnet web development architecture module
 
SynapseIndia dotnet module development part 1
SynapseIndia  dotnet module development part 1SynapseIndia  dotnet module development part 1
SynapseIndia dotnet module development part 1
 
SynapseIndia dotnet framework library
SynapseIndia  dotnet framework librarySynapseIndia  dotnet framework library
SynapseIndia dotnet framework library
 
SynapseIndia dotnet development platform overview
SynapseIndia  dotnet development platform overviewSynapseIndia  dotnet development platform overview
SynapseIndia dotnet development platform overview
 
SynapseIndia dotnet development framework
SynapseIndia  dotnet development frameworkSynapseIndia  dotnet development framework
SynapseIndia dotnet development framework
 
SynapseIndia dotnet website security development
SynapseIndia  dotnet website security developmentSynapseIndia  dotnet website security development
SynapseIndia dotnet website security development
 
SynapseIndia mobile build apps management
SynapseIndia mobile build apps managementSynapseIndia mobile build apps management
SynapseIndia mobile build apps management
 
SynapseIndia java and .net development
SynapseIndia java and .net developmentSynapseIndia java and .net development
SynapseIndia java and .net development
 
SynapseIndia php web development
SynapseIndia php web developmentSynapseIndia php web development
SynapseIndia php web development
 
SynapseIndia mobile apps architecture
SynapseIndia mobile apps architectureSynapseIndia mobile apps architecture
SynapseIndia mobile apps architecture
 
SynapseIndia mobile apps deployment framework architecture
SynapseIndia mobile apps deployment framework architectureSynapseIndia mobile apps deployment framework architecture
SynapseIndia mobile apps deployment framework architecture
 
SynapseIndia dotnet development
SynapseIndia dotnet developmentSynapseIndia dotnet development
SynapseIndia dotnet development
 
SynapseIndia dotnet client library Development
SynapseIndia dotnet client library DevelopmentSynapseIndia dotnet client library Development
SynapseIndia dotnet client library Development
 
SynapseIndia creating asp controls programatically development
SynapseIndia creating asp controls programatically developmentSynapseIndia creating asp controls programatically development
SynapseIndia creating asp controls programatically development
 
SynapseIndia asp.net2.0 ajax Development
SynapseIndia asp.net2.0 ajax DevelopmentSynapseIndia asp.net2.0 ajax Development
SynapseIndia asp.net2.0 ajax Development
 
SynapseIndia mobile apps trends, 2013
SynapseIndia mobile apps  trends, 2013SynapseIndia mobile apps  trends, 2013
SynapseIndia mobile apps trends, 2013
 
SynapseIndia drupal presentation on drupal best practices
SynapseIndia drupal  presentation on drupal best practicesSynapseIndia drupal  presentation on drupal best practices
SynapseIndia drupal presentation on drupal best practices
 
SynapseIndia drupal presentation on drupal
SynapseIndia drupal  presentation on drupalSynapseIndia drupal  presentation on drupal
SynapseIndia drupal presentation on drupal
 
SynapseIndia dotnet debugging development process
SynapseIndia dotnet debugging development processSynapseIndia dotnet debugging development process
SynapseIndia dotnet debugging development process
 

Kürzlich hochgeladen

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Kürzlich hochgeladen (20)

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 

Synapseindia dot net development web applications with ajax

  • 1. Creating Rich Client Web Applications with AJAX
  • 2. Agenda • Web Apps: Whats good, whats not • What is AJAX and how can AJAX help with the bad? • Creating simple AJAX applications • AJAX endpoints and payloads • Using third-party AJAX libraries • AJAX security • ASP.NET 2.0 client callbacks and Atlas
  • 3. The Good, Bad and Ugly (of Web Applications) Condensed Version • The Good – Centralized control of the application – Easy deployment • The Bad – Locked into the browser sandbox – Loose the “thick-client” experience – One way to get data – the browser postback • The Ugly – Browser compatibility
  • 4. How does AJAX help? • Keep all of the good of thin client • Bring the “thick-client” experience much closer to the thin client • Escape the standard client/server HTTP request communications paradigm (the “postback”)
  • 5. What the heck is AJAX? • Asynchronous JavaScript And XML – No new technologies here, just a new name • Takes advantage of modern uplevel browser features: – A client side XML parser (on Windows this is generally the Microsoft XML parser) • Send data to/receive data from the server outside of the browsers standard communications mechanism (eg the postback) • Parse and enumerate XML formatted data on the client – A rich Document Object Model (DOM) • Powerful interaction points between the different elements of your webpage, the browser and browser plugins
  • 6. The standard web client/server request processing model HTTP/1.1 200 OK Date: Fri, 04 Nov 2005 17:17:37 GMT Server: Microsoft-IIS/6.0 P3P: CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI" X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Cache-Control: private Content-Type: text/html; charset=utf-8 Content-Length: 22370 GET / HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727) Host: www.microsoft.com Proxy-Connection: Keep-Alive Cookie: MC1=GUID=5cd2d5ca1a1cc54183c10f4bacaa45fa&HASH=cad5&LV=20059&V=3; A=I&I=AxUFAAAAAABuCAAAzJInmvNBZzRHm8aAr99x0A!!; msresearch=1 Browser makes a resource request to the server <html dir="ltr" lang="en"> <head> <META http-equiv="Content-Type" content="text/html; charset=utf-8" > <!--TOOLBAR_EXEMPT--> <meta http-equiv="PICS-Label" content="(PICS-1.1 &quot;http://www.rsac.org/ratingsv01.html&quot; l gen true r (n 0 s 0 v 0 l 0))" > <meta name="KEYWORDS" content="products; headlines; downloads; news; Web site; what's new; solutions; services; software; contests; corporate news;" > <meta name="DESCRIPTION" content="The entry page to Microsoft's Web site. Find software, solutions, answers, support, and Microsoft news." > <meta name="MS.LOCALE" content="EN-US" > <meta name="CATEGORY" content="home page" > <title>Microsoft Corporation</title> <base href="http://g.msn.com/mh_mshp/98765" > <style type="text/css" media="all"> Server processes the request and returns a result to the browser HTTP Request <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > HTTP Response
  • 7. Demo • A simple HTML postback example
  • 8. Problems with this model • To get any data requires complete round trip to the server which is inefficient • UI suffers because the entire UI must be refreshed as part of the postback, even if it does not change (users see the page “flash”) • User is blocked from continuing to work until the page is returned from the postback
  • 9. The client/server request processing model using AJAX GET /AjaxPresentation/AjaxWithHandler/SimpleAjax.ashx?DataRequest=true&val1=2&val2=2 HTTP/1.1 Accept: */* Accept-Language: en-us Referer: http://localhost/AjaxPresentation/AjaxWithHandler/SimpleAjax.aspx Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727) Host: localhost Proxy-Connection: Keep-Alive Cookie: .ASPXANONYMOUS=AcYSqWXDsOAzMTgxM2IwZi04YzdiLTQyMWMtYjJiNi0yYWVmNDA5OGY0Njg1; ASP.NET_SessionId=rq0avnqjfi5eer45zeq0qdj1 Server processes the request and returns a result to the browser Browser makes a resource request to the server HTTP Request Using XMLHTTP object, an async HTTP request is made to the server JavaScript callback function handles XMLHTTP response HTTP Response HTTP/1.1 200 OK Server: Microsoft-IIS/5.1 Date: Fri, 04 Nov 2005 17:33:53 GMT X-Powered-By: ASP.NET X-AspNet-Version: 1.1.4322 Cache-Control: private Content-Type: text/html; charset=utf-8 Content-Length: 1 4
  • 10. AJAX Advantages • Send an receive only the data you need – Think chatty, not chunky • Only update portions of the page that need to be updated • Asynchronous, so users can continue to work while the page is updated, and more data is fetched
  • 11. Creating Ajax applications • Use JavaScript to instantiate the XML parser //Works in Mozilla (Firefox) and Safari var oXml = new XMLHttpRequest(); Works in Internet Explorer var oXml = new ActiveXObject("Microsoft.XMLHTTP"); • Use the XML object to create a new HTTP request to the server: oXml.Open("GET", “Endpoint.aspx”, true); • Use the XML objects onreadystatechange property to assign a client-side callback method
  • 12. Demo • A simple AJAX demo
  • 13. Side note: Debugging Client Script via Internet Explorer – Enable script debugging – Display script error notifications – Add the “debugger” command to your script • Mozilla supports debugging via Venkman debugger add-in
  • 14. AJAX Endpoints • Anything that can be accessed via HTTP can serve as an AJAX endpoint – Standard ASP.NET webpages (*.aspx) – HTTP Handlers (*.ashx, or custom extenstions) – Web Services (*.asmx) – PHP Web Pages • Think about endpoint performance – ASPX endpoints require a complete page lifecycle to execute on each request – Handlers and Web Services are much more lightweight – Both can access Session, Cache etc
  • 15. Demo • Using Handlers as AJAX endpoints • Accessing Session from an Handler
  • 16. Controlling Asynchronous Communications • Create timer based operations using JavaScripts setInterval command • Make sure you control the number of open HTTP connections, as well as the polling interval
  • 17. Demo • Adding AJAX Asynchronous polling
  • 18. AJAX Payloads • The AJAX “Payload” is the data returned by the HTTP request. • Since Ajax is simply a standard HTTP request/response, the response payload can be anything you like • Examples: – XML, HTML, Simple Types (number, string), JSON • Remember that the actual HTTP payload will always be a type of string, so objects must be serialized
  • 19. Primary Payload Types • Two primary types of payloads in AJAX: – XML • Simple, easy to read format, but you generally must use the MS XML Parser and DOM to work with it • Native to .NET – easy to create on and transport from the server – JSON (JavaScript Object Notation) • Slightly more complex • Data must be massaged into JSON format • Easier to work with once its on the client • Either supports complex object serialization
  • 20. Using XML Payloads • Use the XML DOM to examine and manipulate XML data on the client – ResponseXml property automatically provides a representation of data as parsed by the MSXML XMLDOM parser – XMLDOM provides complete XML navigation concepts: Document, Element, Node – Use client side XSLT to transform or format data – ParseError object tells you if the returned XML was badly formed //Works in Mozilla (Firefox) and Safari var oXsl = new XSLTProcessor(); //Works in Internet Explorer var oXsl = new ActiveXObject("MSXML2.DOMDocument");
  • 21. Demo • Parsing AJAX XML payloads • Using XSLT with AJAX Payloads
  • 22. JSON • JSON (JavaScript Object Notation) is a lightweight data-interchange format. • It is easy for humans to read and write. • It is easy for machines to parse and generate. • Useful as a data-interchange because it can be trivially parsed by JavaScript's built in eval() procedure. var json_data; json_data = ""The quick brown fox.""; myObject = eval("return " + json_data);
  • 23. Examples of JSON • Object serialized to JSON example {"menu": { "id": "file", "value": "File", "popup": { "menuitem": [ {"value": "New", "onclick": "CreateNewDoc()"}, {"value": "Open", "onclick": "OpenDoc()"}, {"value": "Close", "onclick": "CloseDoc()"} ] } }} • The same text expressed as XML: <menu id="file" value="File"> <popup> <menuitem value="New" onclick="CreateNewDoc()" /> <menuitem value="Open" onclick="OpenDoc()" /> <menuitem value="Close" onclick="CloseDoc()" /> </popup> </menu>
  • 24. Other AJAX libraries • Server Side Libraries – Ajax.NET http://ajax.schwarz-interactive.de/csharpsample/default.aspx – PHP & ASP http://cpaint.sourceforge.net/ • Client Side Libraries – Google AJAXSLT http://goog-ajaxslt.sourceforge.net/ – Dojo http://dojotoolkit.org/
  • 25. Ajax.NET • Open Source AJAX implementation for .NET (Note: while still available, the project is not longer being actively developed) • Easy to use. Requires a simple method attribute ( [AjaxMethod()]) to expose server side methods as AJAX endpoints • Automatically uses JSON to transport complex objects like DataSets • Uses dynamically generated JavaScript to create client side proxies for server side objects • Supports transport of integers, strings, doubles, booleans, DateTime, DataSets, DataTables and primitive types of custom classes and arrays • Other types supported via Custom Type converters
  • 26. Demo • Using Ajax.NET
  • 27. AJAX Security • HTTPS is your friend • Keep sensitive code or data on the server where you can control it • By default everything is sent clear text over the wire (including client side code), and could potentially be captured in transit and modified • JavaScript has no intrinsic over-the-wire encryption support, but you can implement your own encryption (search Google for ‘AJAX encryption’)
  • 28. Client Callbacks • New Feature in ASP.NET 2.0 • Add client-side callbacks to your web pages or server controls • Executes in the context of the current page – Allows you to access existing control state on the server during the callback process – Keeps you from having to pass as much data back • Not as flexible in setting endpoints, and passing arguments
  • 29. Atlas • Microsofts next generation AJAX framework – Cross browser compatible • Includes both declarative and imperative programming models – Code in vanilla JavaScript, or use the Atlas “tag” programming model • Attempts to bring JavaScript to a first class language – Uses abstraction layers to add familiar programming constructs like Types, Enumerations, Class Inheritance – Also uses abstraction layers to abstract cross browser problems • Includes a number of controls for common functionality
  • 30. Declarative Atlas <page xmlns:script="http://schemas.microsoft.com/xml-script/2005" xmlns:wiki="wiki"> <components> <label targetElement="loadingMsg1"> <bindings> <binding dataContext="documentsSource1" dataPath="isReady" property="visible" transform="Invert"/> </bindings> </label> <textBox targetElement="<%= navCategoryID.ClientID %>" /> <textBox targetElement="<%= navDefaultDocumentTitle.ClientID %>"/> <textBox targetElement="recurseSubfolders1"/> <dataSource id="documentsSource1" serviceURL="<%= ResolveUrl("~/WebServices/DocumentWebService.asmx") %>"> <bindings> <binding dataContext="<%= navCategoryID.ClientID %>" dataPath="text" property="selectParameters" propertyKey="categoryID"/> <binding dataContext="<%= navDefaultDocumentTitle.ClientID %>" dataPath="text" property="selectParameters“ propertyKey="defaultDocumentTitle"/> <binding dataContext="recurseSubfolders1" dataPath="text" property="selectParameters" propertyKey="strRecurseSubfolders"/> </bindings> </dataSource>