Common Web Mapping Application


Purpose
This sample provides the project and source code for the Web Mapping Application included as a template integrated into Visual Studio 2008 with the Web Application Developer Framework (ADF). The Web Mapping Application is an out-of-the box application that can be used for viewing and querying maps. This template is used by the ArcGIS Server Manager (Manager) application to create a Web ADF application without using Visual Studio or writing code. The template is also provided as an ASP.NET template in Visual Studio 2008 and 2010.
 
The Web Mapping Application contains many Web ADF controls and capabilities. Before running the application, you need to select at least one resource to display on the map. To do this, set the MapResourceItems property on the MapResourceManager control. Help for the Web Mapping Application is included in the Manager Help system as well as a Help link available in the application at run time.

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.

At 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 Developer Kit install location>\Samples\ServerNET\Common_WebMappingApp.
  3. Open the folder of the language you're going to use—CSharp or VBNet—and copy the Common_WebMappingApp_<language> folder to c:\inetpub\wwwroot. The <language> variable can be either CSharp or VBNet.
  4. Open the IIS Manager from Control Panel > Administrative Tools > Internet Information Services (IIS) Manager or Internet Information Services.
  5. In the console tree view on the left, navigate to Local Computer > Web Sites > Default Web Site, expand Default Web Site, right-click the Common_WebMappingApp_<language> folder, and click Properties. The Properties dialog box opens.
  6. Click the Directory tab, click the Create button in the Application Settings section, then click OK to close the Properties dialog box.
  7. Start Microsoft Visual Studio 2008 or 2010 and open the Common_WebMappingApp_<language><vs_version> solution (for example, Common_WebMappingApp_CSharp2008.sln) located in c:\inetpub\wwwroot\Common_WebMappingApp_<language>.
  8. In Solution Explorer, right-click Default.aspx, and select Set As Start Page.
  9. Open the Default.aspx page in Design view, open the properties window for the MapResourceManager control, and click the ellipsis next to the ResourceItems property. The ResourceItem Collection Editor dialog box opens.
  10. Add a new MapResourceItem associated with a map service (ArcGIS Server, ArcIMS, ArcWeb, and so forth).
  11. If necessary, set the run time identity of the Web application by following one of the next two steps. If not necessary, proceed to step 14.
  12. At design time, the identity of the user running Visual Studio is used to connect to an ArcGIS Server local data source. At run time, that identity is established by the Web application. Only one identity can be used to define access to the ArcGIS Server local data sources in a single Web application. This identity can be explicitly defined when building the Web ADF application in Visual Studio by right-clicking the Web project in Solution Explorer and selecting the Add ArcGIS Identity option. Enter the identity credentials that will be used to access ArcGIS Server local resources at run time. This information is added to the web.config file in a standard ASP.NET identity tag. If the Encrypt identity in web.config check box is checked, the identity tag is encrypted; otherwise, the username and password are stored as clear text.
  13. Open the web.config file, add an <identity> element to <system.web>, set the impersonate attribute to true, and add a username and password attribute and set them to a valid user account. If you're working with ArcGIS Server local data sources, ensure the account has access to the geographic information system (GIS) server resources referenced in the Map control.
  14. Save the project.
  15. Click the Debug drop-down menu and click Start Debugging.

At run time
  1. Open a browser and navigate to the viewer uniform resource locator (URL).
  2. Click the Help link in the upper right corner of the application, and use the Help system to navigate the capabilities of the Web Mapping Application.

Common_WebMappingApp_CSharp\ApplicationClosed.aspx Helper page to close the application.
Common_WebMappingApp_CSharp\ApplicationClosed.aspx.cs Code behind the .aspx page.
Common_WebMappingApp_CSharp\Default.aspx Contains the Web user interface to interact with server-side code.
Common_WebMappingApp_CSharp\Default.aspx.cs Code behind the .aspx page. References Web ADF libraries and functionality.
Common_WebMappingApp_CSharp\ErrorPage.aspx User interface for the pop-up Identify Details window in the browser.
Common_WebMappingApp_CSharp\ErrorPage.aspx.cs Code behind the .aspx page. Used to create and populate the pop-up Identify Results windows in the browser.
Common_WebMappingApp_CSharp\Measure.ascx User interface to display results in a directory tree containing references to one or more features.
Common_WebMappingApp_CSharp\Measure.ascx.cs Code behind the .aspx page. Used to manage the feature attribute data in the Identify Results window in the browser.
Common_WebMappingApp_CSharp\App_Code\Native64BitSupport.cs Support for running application in 64-bit application pool
Download the C# files
Common_WebMappingApp_VBNet\ApplicationClosed.aspx Helper page to close the application.
Common_WebMappingApp_VBNet\ApplicationClosed.aspx.vb Code behind the .aspx page.
Common_WebMappingApp_VBNet\Default.aspx Contains the Web user interface to interact with server-side code.
Common_WebMappingApp_VBNet\Default.aspx.vb Code behind the .aspx page. References Web ADF libraries and functionality.
Common_WebMappingApp_VBNet\ErrorPage.aspx User interface for the pop-up Identify Details window in the browser.
Common_WebMappingApp_VBNet\ErrorPage.aspx.vb Code behind the .aspx page. Used to create and populate the pop-up Identify Results windows in the browser.
Common_WebMappingApp_VBNet\Measure.ascx User interface to display results in a directory tree containing references to one or more features.
Common_WebMappingApp_VBNet\Measure.ascx.vb Code behind the .aspx page. Used to manage the feature attribute data in the Identify Results window in the browser.
Common_WebMappingApp_VBNet\App_Code\Native64BitSupport.vb Support for running application in 64-bit application pool
Download the VB.NET files

Download the files for all languages