Create a simple ArcGIS Server ASP. NET webpage

Source: Internet
Author: User
Before running this example, you must install. Net ADF on the network server. The ArcGIS Server has been installed and runs properly to meet all system requirements.
1. Create an ASP. NET application directory. You can follow the steps below to create:
(1) create a directory under your directory <drive>: inetpubwwwroot.
(2) Use the IIS manager to view the properties of the newly created directory.
(3) On the directory label, click the create button to create an ASP. NET application.
2. Set the following Code Copy the file to the text editor and save it as a *. aspx file. Edit it as follows:
(1) Change the host attribute in the ESRI: Map label to the machine running ArcGIS Server som (Server Object Manager.
(2) Change serverobject to a running mapserver Server Object. Remember that the name of the server object is case sensitive.
<% @ Register tagprefix = "ESRI" namespace = "ESRI. ArcGIS. server. webcontrols"
Assembly = "ESRI. ArcGIS. server. webcontrols, version = 9.0.0.2, culture = neutral, publickeytoken = 8fc3cc631e44ad86" %>

<HTML>
<Head>
</Head>
<Body>
<Form ID = "webform" method = "Post" runat = "server">
<ESRI: Map id = "themap" usemimedata = "true" width = "400px" Height = "250px"
Style = "Left: 200px; position: relative; top: 30px" runat = "server"
Borderstyle = "solid" bordercolor = "0, 0, 255" borderwidth = "5px"
Serverobject = "China Geological Map" host = "pengling" autofirstdraw = "true">
</ESRI: Map>
</Form>
</Body>
</Html>
3. Create a web. config file under the ASP. NET application directory. The following shows an example of a web. config file.
Use the account in the agsusers group on the ArcGIS Server machine to configure this file.
Writing the user name and password in plain text in the web. config file may not be a security method for storing this information. Microsoft provides an encryption mechanism. This example is only used for diagnosis.
<? XML version = "1.0" encoding = "UTF-8"?>
<Configuration>
<System. Web>
<! -- Session state must be enabled for the map control -->
<Sessionstate mode = "inproc"/>
<Identity impersonate = "true" username = "" Password = ""/>
</System. Web>
</Configuration>
4. Enter http: // servername/virtualdirectory/MyApp. aspx in the browser to test the application. Program .
If ArcGIS Server is installed and. Net ADF works properly, a map is displayed.

5. After the test, delete the files in the directory, especially the Web. config file containing the plaintext password.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.