Developing Web Applications with the Web ADF - Web controls  

TaskResults control

The TaskResults control is designed to store the results of tasks that produce ADO.NET DataSet output.  The results are presented as nodes in a TreeView.  The TaskResults control also enables the ability to zoom or pan to a feature, highlight a feature in a result set, re-run a task, or remove task results.  

Assembly: ESRI.ArcGIS.ADF.Web.UI.WebControls.dll
Class: ESRI.ArcGIS.ADF.Web.UI.WebControls.TaskResults
Using the TaskResults control
  1. Add supporting controls to the page

    In order to take full advantage of the TaskResults control, a number of supporting controls must be available.  Set up a Web application with a MapResourceManager and Map control using their discussion topics as a guide. Add a TaskManager, Menu and a SearchAttributesTask control using their discussion topics as a guide. At runtime, the TaskResults control displays the results of executing the task. A user can then interact with the results to change map extent, display selected features, or re-execute the task. 

    The TaskResults accepts the results output from other task controls as well. These include QueryAttributesTask, FindAddressTask, and FindPlaceTask. It can also accept results from custom tasks. Use the same logic as discussed below to buddy the task to the TaskResults control (step 4 below).
  2. Add the TaskResults control to the page

    In Visual Studio, open a Web form in design mode, select the Toolbox, and expand the ArcGIS Web Controls tab.  Drag and drop a TaskResults control on the Web form.  You should now see the following in Visual Studio:

  3. Buddy the TaskResults control to the Map control

    This step is only required if you want to interactively work with results in the Map.   Set the Map property on the TaskResults control to buddy it with a Map control.

  4. Buddy the task control with the TaskResults control

    To display the results of a task, you must buddy the task control with the TaskResults control.  Select the task control (in this example, the SearchAttributesTask control) and modify the TaskResultsContainers property.  In the buddy control dialog, add a new item and select the id of the TaskResults control you want to display the task results. 

  5. Run the application and execute the task

    When a task is executed at runtime, the TaskResults control displays an animated gif to indicate that the task is working.  A Cancel link is also displayed to cancel the task before it completes.  In the following example, the task is searching the US States layer for state names that contain the text "New".  The arrow indicates the location of the task execution indicator in the TaskResults control. 

  6. Navigate the results of a task

    When task execution completes, the results are returned in the TaskResults control in a TreeView.  A user can expand and collapse the branches of the results collection to view result items.  If attributes are returned, a user can expand its branch to view feature attribute values.  If features are returned, they are rendered in the map using client-side graphics.  By default, the results are selected (box is checked).  Hover over a feature node to highlight the cooresponding graphic feature in the map. 

  7. Using the context menu on a result item

    A user can right-click the context menu on a result item and select from the following options:
    a) Zoom to - zoom to the result item in the map
    b) Pan to - pan the map to center on the result item
    c) Remove - remove the result item from the task results list 

  8. Using the context menu on a result item collection 

    One task results node can contain multiple result item collections, referred to programatically as graphics nodes.  A user can right-click the context menu on the task results collection to:
    a) Zoom To Selected Features - zoom to the map extent that includes the results in the collection. 
    b) Remove - remove this result item collection from the TaskResults control

  9. Using the context menu on the task results 

    A user can right-click the context menu on the task results collection to:
    a) Rerun task - execute the same task again and update this task result collection
    b) Remove - remove this task results collection from the TaskResults control

  10. Map tips on task results

    Client graphics are generated for task results by default, thus the graphic features associated with results have map tips enabled.  Map tips and result content can be modified at design-time on the specific task control buddied to the TaskResults control. 

  11. Display multiple task results in the TaskResults control

    Each time a task is executed, a new task results collection is created in the TaskResults control.





  The following table provides a list of properties of interest.  For complete reference information, see the TaskResults control in the library reference section.

Property Name  Type Description
Map string The Map control ID to which the TaskResults control will be buddied to.
GraphicsTransparency float Percentage transparency of graphic features associated with results.  0 = opaque, 100 = transparent.  
ResultsInsertLocation ResultsInsertLocation Location in the TaskResults control where new result are added.   The default is the Top of the list.
ZoomToPointFactor double When zooming to points, this is the number which the full extent will be divided by in order to calculate the extent to zoom to.