In this topic
About tasks and the Web ADF
Tasks are defined as a set of related actions that provide common results. The Web Application Developer Framework (ADF) provides a task framework to create, integrate, and distribute components or Web tasks.
Web ADF Task Framework
A Web task is an ASP.NET Web control that utilizes and extends the Web ADF Task Framework to encapsulate custom functionality in a distributable component. The framework includes the following:
- Interfaces and abstract classes to create custom tasks
- Controls to support task management and results
- Pluggable architecture to integrate a custom task in Visual Studio or ArcGIS Manager (Manager)
In addition, a set of out-of-the-box task controls are included with the Web ADF to support common geographic information system (GIS) functionality requirements in a Web application.
Interfaces and classes
The following illustration shows the interfaces and classes in the task framework:
- The items in "red" are part of the Web ADF Task Framework.
- The items in "green" show where you can customize the task framework and how it is related to existing framework components.
- The Task and FloatingPanelTask abstract classes implement the basic ITask interface. All interfaces can be used to create a custom task depending on the capabilities required by the task.
This is all that is required to create a custom task. However, to integrate with other Web ADF components, you can customize other task components by using the following:
- ITaskDesigner to customize the Visual Studio design-time verbs available on the custom task control.
- IWebConfigurator interface to define how to integrate the custom task into the Manager application. This enables you to select the custom task from a list when creating a new Web application using Manager.
- ITaskResultsContainer interface to define a custom container or control to display task results.
ITask is the core task interface in the ESRI.ArcGIS.ADF.Web.UI.WebControls namespace. At a basic level, a task must implement the ITask interface. The interface definition is shown in the following code example:
[HTML]
namespace ESRI.ArcGIS.ADF.Web.UI.WebControls
{
public interface ITask
{
string ShowUrl { get;}
string Title { get; set;}
string ToolTip { get;set;}
string NavigationPath { get; set;}
BuddyControlCollection TaskResultsContainers { get;}
object Results { get;set;}
void ExecuteTask();
string TaskActivityIndicatorText { get;}
bool GroupResultsByTable { get;set;}
bool ShowFieldAttributes { get;set;}
bool ShowLegend { get; set;}
object Input { get; set;}
void Refresh();
void Show();
CallbackResultCollection CallbackResults { get;}
string UniqueID { get;}
List<GISResourceItemDependency> GetGISResourceItemDependencies();
}
}
The Task and FloatingPanelTask abstract classes handle most of the overhead associated with ITask implementation and can be extended. Use these classes to get started. The main difference between the two, is a custom task that extends Task is not contained in the FloatingPanel, but a custom task that extends FloatingPanelTask is contained in FloatingPanel at run time. See the following illustration:

Tasks are essentially ASP.NET composite controls. As a result, both Task and FloatingPanelTask extend System.Web.UI.WebControls.CompositeControl. CompositeControl implements the ICallbackEventHandler interface, which enables a control to work with Asynchronous JavaScript and XML (AJAX) functionality in an ASP.NET Web application.
The IBuddyControlSupport interface defines a method to return the types of controls the custom task can buddy with. The Task and FloatingPanelTask classes define the controls of type ITaskResultsContainer that can be buddied with them, such as the TaskResults control.
Task support controls
The following task support controls enhance the Web task run time experience (their use is optional):
- TaskManager—Organizes tasks in a Web application. The TaskManager control generates hierarchical Extensible Markup Language (XML) data that can be used by an ASP.NET navigation control, such as Menu or TreeView. At run time, nodes in the ASP.NET Menu or TreeView can be used to display the floating panel for a task. The TaskManager control is only visible at design time.
- TaskResults—Stores the results of tasks that produce ADO.NET DataSet output. The results are presented as nodes in TreeView. You can also use the TaskResults control to zoom or pan to a feature, highlight a feature in a result set, re-run a task, or remove task results.
Out-of-the-box task controls
All task controls implement and extend the task framework to be fully integrated with Web ADF application creation capabilities and development environments. The controls include the following:
- SearchAttributesTask—Enables you to select a set of fields, provided by resources, in which to search for the occurrence of a user-provided value. At run time, each field is queried for the occurrence of a user-provided value. Partial values are permitted. Only feature layers in resources provided by MapResourceManager can be used. The results are provided as an ADO.NET DataSet to be displayed in a TaskResults control.
- QueryAttributesTask—Enables you to explicitly define the parameters used to query values in a field. This control enhances the basic query capability of SearchAttributesTask. At run time, the QueryAttributesTask query can provide a drop-down list of preset choices or a text box for general text entry. Each query can use a validator to restrict the values added. In addition, multiple queries can be grouped to produce a single result. Only feature layers in resources provided by MapResourceManager can be used. The results are provided as an ADO.NET DataSet to be displayed in a TaskResults control.
- FindAddressTask—Utilizes resources in GeocodeResourceManager to perform geocode operations. The control interface is created dynamically at run time, based on the inputs required by the geocode resource it uses. The results (match or address candidates) are provided as an ADO.NET DataSet to be displayed in a TaskResults control.
- GeoprocessingTask—Uses resources in GeoprocessingResourceManager to execute geoprocessing tasks. The control interface is created dynamically at run time, based on the inputs required by the geoprocessing resource and the task it uses. The results, which include input and output parameters, and progress messages, are provided as an ADO.NET DataSet to be displayed in a TaskResults control.
- EditorTask—Provides a suite of tools for Web-based editing of features in both versioned and non-versioned enterprise geodatabases. If configured, specific versions can be selected for editing. The run time dialog box provides tools to modify, add, and remove feature geometry and attributes.
- PrintTask—Provides run time print capabilities to a Web ADF application. It enables you to print a map and task results, along with a legend, scale bar, copyright, and north arrow.
UserControlTask Control
The UserControlTask control enables you to integrate an ASP.NET user control as a task within an ADF application. The Web ADF Task Framework includes a base class, ESRI.ArcGIS.ADF.Web.UI.WebControls.UserControlTaskPanel, that you can subclass in an ASP.NET user control to gain access to task framework behavior and capabilities. It is easy to use and gives a real design-time experience to developers.
The UserControlTask only works with the ASP.NET Asynchronous JavaScript and XML (AJAX) partial postback pattern for asynchronous communication in a Web application.
A ScriptManager must be on the page for the UserControlTask to function.
See Also:
Walkthrough: Creating a custom server taskUserControlTask control