ADF tutorials


Purpose
This sample contains the projects and source code for the Application Developer Framework (ADF) tutorials included with the ArcGIS for Server software development kit (SDK) Help system. Each tutorial is included in a separate folder within the ADFTutorial solution.
The following tutorials are included:
  • Creating a Web application with the Web controls—Illustrates basic techniques for creating a simple Web application that uses ADF controls. This is included in the ADFWebControls folder.
  • Using the Common Data Source API in a Web application—Illustrates how to work with the ADF's Common Data Source application programming interface (API) to generate selected features and interact with Web ADF controls. This is included in the UsingCommonAPI folder.
  • Accessing ArcGIS for Server from a Web application—Shows how to use the ArcGIS Server ArcObjects and Simple Object Access Protocol (SOAP) APIs in a Web ADF application. This is included in the AccessArcGISServer folder.
  • Accessing ArcIMS from a Web application—Shows how to use the ArcIMS API in a Web ADF application. This is included in the AccessArcIMS folder.
  • Developing a scriptable Web ADF control—Illustrates how to build and use a scriptable ADF control. The following projects are included in the ScriptableControl folder:
    • Scriptable control
    • Web site to demonstrate its use
Note: Local (DCOM) connections are only supported for ArcGIS for Server versions prior to 10.1.

How to use

If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

Design time
  1. Verify that the Web ADF for the .NET Framework is installed and functioning properly. For information on installing and configuring the Web ADF, consult the installation guide.
  2. In Windows Explorer, navigate to <ArcGIS install location>\DeveloperKit10.0\Samples\ServerNet\ADFTutorials. You should see a CSharp and VBNet folder.
  3. In Windows Explorer, open the directory referencing the applicable language, that is, CSharp or VBNet. Copy the folder, ADFTutorials_<language>, to c:\inetpub\wwwroot. The <language> variable can be CSharp or VBNet.
  4. To start the IIS Manager, click Start, Control Panel, Administrative Tools, Internet Information Services (IIS) Manager or Internet Information Services.
  5. On the console tree view on the left, click Local Computer, Web Sites, and Default Web Site.
  6. Open the ADFTutorials_<language> folder, then open the applicable tutorial folder. In the selected tutorial, select the Web site folder and click Properties.
  7. On the Directory tab, click the Create button in the Application Settings section of this panel. Click OK to close the Properties dialog box.
  8. Start Visual Studio 2010 and open the solution located in the c:\inetpub\wwwroot\ADFTutorials_CSharp folder.
  9. In the Solution Explorer, right-click the Web site under the applicable tutorial and select Set as StartUp Project. Also, right-click the page you want to view and select Set As Start Page.
  10. The pages in this sample are configured to use data hosted online or included with the SDK. You can create services from SDK data by publishing the map documents located at <ArcGIS install location>\DeveloperKit10.0\Samples\data. For instructions on how to publish a map document to ArcGIS for Server, see "About publishing GIS resources to the server" in the ArcGIS for Server Help system.
  11. Click the Debug menu and choose Start.

Run time
  1. Browse to the viewer's uniform resource locator (URL), for example, http://localhost/ADFTutorials_VBNet/ADFWebControls/.
  2. For the page in the ADFWebControls—Interact with the map. Use the toolbar items. Change layer visibility in the Toc.
  3. For the page in the UsingCommonAPI—Use drop-down lists to select the active resource and layer. Use the custom tool to select features in the map. Show the selection in the TaskResults.
  4. For the page in AccessArcGISServer—Apply the custom tool in the map to add a point and buffer around the point as graphics. Graphics are added to the custom graphics element array for a MapDescription.
  5. For the page in AccessArcIMS—Apply the custom tool in the map to add a point as graphics in an acetate layer.
  6. For the page in ScriptableControl—Hover the cursor over the map and note the changes in the coordinate display of the scriptable control.

ADFTutorials_CSharp\AccessArcGISServer\Default.aspx.cs ArcGIS for Server tutorial demo.
ADFTutorials_CSharp\AccessArcGISServer\App_Code\PointBufferTool.cs The code behind the user interface (UI).
ADFTutorials_CSharp\AccessArcIMS\Default.aspx.cs ArcIMS tutorial demo.
ADFTutorials_CSharp\AccessArcIMS\App_Code\PointTool.cs The code behind the UI.
ADFTutorials_CSharp\ADFWebControls\Default.aspx.cs ADF control demo.
ADFTutorials_CSharp\ScriptableControls\MapCoordinateDisplayWebSite\Default.aspx.cs Scriptable control demo.
ADFTutorials_CSharp\ScriptableControls\MapCoordinateDisplay\Properties\AssemblyInfo.cs Scriptable control demo.
ADFTutorials_CSharp\ScriptableControls\MapCoordinateDisplay\MapCoordinateDisplay.cs Scriptable control demo.
ADFTutorials_CSharp\ScriptableControls\MapCoordinateDisplay\javascript\MapCoordinateDisplay.js Scriptable control demo.
ADFTutorials_CSharp\UsingCommonAPI\Default.aspx.cs Common API demo.
ADFTutorials_CSharp\UsingCommonAPI\App_Code\SelectTool.cs The code behind the UI.
Download the C# files
ADFTutorials_VBNet\AccessArcGISServer\Default.aspx.vb ArcGIS for Server tutorial demo.
ADFTutorials_VBNet\AccessArcGISServer\App_Code\PointBufferTool.vb The code behind the user interface (UI).
ADFTutorials_VBNet\AccessArcIMS\Default.aspx.vb ArcIMS tutorial demo.
ADFTutorials_VBNet\AccessArcIMS\App_Code\PointTool.vb The code behind the UI.
ADFTutorials_VBNet\ADFWebControls\Default.aspx.vb ADF control demo.
ADFTutorials_VBNet\ScriptableControls\MapCoordinateDisplayWebSite\Default.aspx.vb Scriptable control demo.
ADFTutorials_VBNet\ScriptableControls\MapCoordinateDisplay\Properties\AssemblyInfo.vb Scriptable control demo.
ADFTutorials_VBNet\ScriptableControls\MapCoordinateDisplay\MapCoordinateDisplay.vb Scriptable control demo.
ADFTutorials_VBNet\ScriptableControls\MapCoordinateDisplay\javascript\MapCoordinateDisplay.js Scriptable control demo.
ADFTutorials_VBNet\UsingCommonAPI\Default.aspx.vb Common API demo.
ADFTutorials_VBNet\UsingCommonAPI\App_Code\SelectTool.vb The code behind the UI.
Download the VB.NET files

Download the files for all languages

See Also:

About publishing GIS resources to the server