This is a mirror of official site: http://jasper-net.blogspot.com/

AJAX and the ASP.NET 2.0 Callback Framework

| Thursday, December 30, 2010
Interaction with a Web application can be initiated via a synchronous page postback or an out-of-band postback, known as a client callback, from the client to the server.  The default ASP.NET Web page model uses synchronous page postbacks, which are usually triggered on the client by submitting an html form.  During a page postback, the Web page and controls are recreated and a new version of the entire Web page is rendered on the client.  In addition, most of the application logic is present on the server-side.   Unfortunately page postbacks often introduce a great deal of processing overhead which can decrease performance.  Since the entire page must be reconstructed via a synchronous request to the server, the client must wait for a response to continue working.  On the other hand, client callbacks can improve performance and enhance the end user experience when working with a Web application.   Callbacks utilize a set of technology standards commonly referred to as AJAX (Asynchronous JavaScript and XML).

AJAX includes:
Presentation content using XHTML and CSS
Dynamic display and interaction with XHTML (DHTML) using the Document Object Model (DOM)
Data interchange using strings, often in XML format
Asynchronous data retrieval using an http request object
JavaScript - to bind everything together

Client callbacks can be synchronous or asynchronous.  In either case, the browser creates a new connection to send the callback to a remote server, thus the callback is out-of-band.  The contents of the entire page do not need to be submitted, so the page lifecycle for a callback skips events associated with rendering page contents on the server.   In addition, sending an asynchronous callback to a server permits an end user to continue working in the client application while the request is processed.  When the response is returned, the appropriate content in the Web page is updated without refreshing the entire page.  The diagrams below illustate the difference between synchronous and asynchronous communication between a client application and a server.

Synchronous
sync.png

Asynchronous
async.png

Posted via email from .NET Info

0 comments: