How to use
Data has been provided for your use with this sample. It can be found at
<Your ArcGIS Developer Kit Install directory>/Samples/data/USA.
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.
At design time
- Verify that the Web Application Developer Framework (ADF) for the .NET Framework is installed and functioning properly. For information on installing and configuring the Web ADF, consult the installation guide.
- In Windows Explorer, navigate to <ArcGIS Developer Kit install location>\Samples\ServerNET\ArcGIS_NAServer_Routing.
- Open the folder of the language you're going to use—CSharp or VBNet—and copy the ArcGIS_NAServer_Routing_<language> folder to c:\inetpub\wwwroot. The <language> variable can be either CSharp or VBNet.
- Open the IIS Manager from Control Panel > Administrative Tools > Internet Information Services (IIS) Manager or Internet Information Services.
- In the console tree view on the left, navigate to Local Computer > Web Sites > Default Web Site, expand Default Web Site, right-click the ArcGIS_NAServer_Routing_<language> folder, and click Properties. The Properties dialog box opens.
- Click the Directory tab, click the Create button in the Application Settings section, then click OK to close the Properties dialog box.
- Start Microsoft Visual Studio. Open the solution for the version of Visual Studio you're using. The Visual Studio version is appended to the solution file name. For example, the Visual Studio 2008 solution file for the ArcGIS_NAServer_Routing_CSharp sample is ArcGIS_NAServer_Routing_CSharp2008.sln and is located in the c:\inetpub\wwwroot\ArcGIS_NAServer_Routing_CSharp folder.
- In Solutions Explorer, right-click Default.aspx and select Set As Start Page.
- If necessary, modify the member variables at the top of the code-behind for Default.aspx or Default_Static.aspx. The ArcGIS Server name is referenced.
- Change the identity specified in web.config manually or by right-clicking the project and clicking Add ArcGIS Identity. The user account specified must have access to the geographic information system (GIS) server resources referenced in the Map control.
- Click the Debug drop-down menu and click Start.
- Address any errors that occur in the debugging process.
At run time
- Browse to the default uniform resource locator (URL) (for example, http://localhost/ArcGIS_NAServer_Routing_CSharp/Default.aspx).
- Type the addresses where you want to start and end.
- Click Find Route. A route is generated and added as graphics to the Map control.
- Browse to the other Web page URL (for example, http://localhost/ArcGIS_NAServer_Routing_CSharp/Default_Static.aspx).
- Type the addresses where you want to start and end.
- Click Find Route.
ArcGIS_NAServer_Routing_CSharp\Default.aspx | Contains the user interface (UI) for finding a route and displaying it in a Map control as well as the directions in a data grid. |
ArcGIS_NAServer_Routing_CSharp\Default.aspx.cs | Code behind the .aspx file. Performs route network analysis and adds the route and stops returned by the NAServer Web service as graphics to a Map control. |
ArcGIS_NAServer_Routing_CSharp\Default_Static.aspx | Contains the UI for finding a route and displaying it in an Image control as well as the directions in a data grid. |
ArcGIS_NAServer_Routing_CSharp\Default_Static.aspx.cs | Code behind the .aspx file. Performs route network analysis and draws the image returned by the NAServer Web service. |
ArcGIS_NAServer_Routing_CSharp\MapImage.aspx | Page used to draw the map image returned by the NAServer Web service. |
ArcGIS_NAServer_Routing_CSharp\MapImage.aspx.cs | Code behind the .aspx file. Displays the map image returned by the NAServer Web service. |
ArcGIS_NAServer_Routing_VBNet\Default.aspx | Contains the user interface (UI) for finding a route and displaying it in a Map control as well as the directions in a data grid. |
ArcGIS_NAServer_Routing_VBNet\Default.aspx.vb | Code behind the .aspx file. Performs route network analysis and adds the route and stops returned by the NAServer Web service as graphics to a map control. |
ArcGIS_NAServer_Routing_VBNet\Default_Static.aspx | Contains the UI for finding a route and displaying it in an Image control as well as the directions in a data grid. |
ArcGIS_NAServer_Routing_VBNet\Default_Static.aspx.vb | Code behind the .aspx file. Performs route network analysis and draws the image returned by the NAServer Web service. |
ArcGIS_NAServer_Routing_VBNet\MapImage.aspx | Page used to draw the map image returned by the NAServer Web service. |
ArcGIS_NAServer_Routing_VBNet\MapImage.aspx.vb | Code behind the .aspx file. Displays the map image returned by the NAServer Web service. |
Download the files for all languages