ASP.NET supports both synchronous and asynchronous communication with Web applications. The Web ADF controls are designed leverage two AJAX patterns packaged for use with ASP.NET: ASP.NET script callbacks and ASP.NET AJAX. Both are provided by Microsoft to enhance the Web application developer and user experience. It is recommended that you are familiar with AJAX and ASP.NET technologies and concepts before proceeding.
As a Web ADF developer, you have the option to select which AJAX pattern you will utilize in your Web application. In version 9.2, the Web ADF only supported the ASP.NET script callback framework. As a result, many existing applications have been built on the callback model for asynchronous communication. This model remains valid and supported in 9.3. However, the 9.3 Web ADF also supports the latest Microsoft AJAX solution, ASP.NET AJAX. The Web ADF controls are only designed to use one model for asynchronous communication per page. The presence of an ASP.NET AJAX ScriptManager control in a page dictates which model will be used. If a ScriptManager is present, Web ADF controls will use the ASP.NET AJAX partial postback model. If a ScriptManager is not present in the page, the Web ADF controls will use the ASP.NET script callback model. Note, the ScriptManager must be the first control in the page.
In many cases, working with AJAX capabilities in the Web ADF will differ depending on which AJAX solution you choose. However, there are some common components and concepts shared by both. In general, any client-server interaction in the Web ADF will involve an action request and response, followed by subsequent asynchronous requests to handle changes made during the initial postback. In most cases, an action request is initiated by a user action in the browser (e.g. zooming in on a map). If the action request is sent to the current page, it may be a synchronous full postback, an asynchronous partial postback, or a callback (also a type of postback).
Each postback to a page in a Web application will iterate through the page lifecycle. The type of postback will dictate the which lifecycle events are triggered and the response content. Subsequent requests can be asynchronous and may iterate through the page lifecycle or just request a remote resource, like an image. As a result, a single user action in the browser may generate multiple requests, some of which iterate through the page lifecycle. For a postback to a page, iterating through the page lifecycle is required because the page and its contents must be reconstructed to process a request.
Regardless of which Microsoft AJAX pattern is used, the Web ADF includes an internal framework to synchronize changes to the state of client and server content in an asynchronous environment. This framework, termed the "callback result framework", is founded on Web ADF "callback results" which are messages generated on the server to communicate changes with the client. The following logical areas in the Web ADF are integral to leveraging the callback result framework and Microsoft AJAX solutions. As a developer, you can utilize one or more of these component areas to create and manage custom Web ADF AJAX solutions.
From response perspective, the ESRI.ADF.System.processCallbackResult function is most important. Most Web ADF controls generate callback results when their state changes on the server. The ESRI.ADF.System.processCallbackResult function is designed to parse and process callback results from Web ADF controls and update their content, at runtime, on the client.
Tool/command interfaces accessed via a Toolbar control to easily
process callbacks on the server
The Toolbar control provides a prepackaged framework for adding client-side tools to interact with Web ADF controls. You only need to create a class on the server that implements the appropriate interface (depending on the type of toolbar item) and add that class to the Toolbar. Implementation code in the toolbar item class can interact and change any server-side resource and the postback is managed for you. This is the easiest way to tap into the AJAX capabilities of the Web ADF, but requires you to work within the context of a Toolbar control.
Public callback properties on each Web ADF control
Custom classes to create and manage callback messages
Choosing which AJAX solution works for you depends on business rules,
application requirements, and technical expertise. Both ASP.NET script
callbacks and ASP.NET AJAX are supported equally. In
either case, is important to understand the content and capabilities of the Web
ADF callback results framework. It is discussed in detail in the topic
Working with CallbackResults . Once you decide which
AJAX solution you will use with Web ADF controls in a Web page,
underlying techniques for working the AJAX capabilities of the Web ADF
will differ. This includes the techniques for packaging callback
results in an asynchronous Web response. Each AJAX pattern is
presented in a separate topic: ASP.NET callback
solutions and ASP.NET AJAX partial
postback solutions .