To create feature rich Web applications without writing code, use the Manager Web application. See the section titled Developing Web Applications with Manager for additional details. Manager creates a predefined Web application, ready for deployment. Although Manager provides a number of options to customize your Web application, you may choose to extend it further.
Web applications created from Manager use the same template as is used when creating a new website in Visual Studio 2005 with the "Web Mapping Application" template. Manager sets properties in the template, such as the map servers and services, as well as tasks included and the theme (colors, logos, etc.) of the application.
Whether created in Manager or Visual Studio, a web mapping application contains standard web page design elements, plus web controls. These web controls include both standard ASP.NET web controls, as well as ESRI ADF-specific web controls.
You can modify the contents of a web mapping application by adding, removing and modifying web controls and other web content.
The web mapping application contains the following items:
The web mapping application also uses files in the common ASP.NET folder aspnet_client stored in the root IIS folder. These files are normally in C:\Inetpub\wwwroot\aspnet_client\ESRI\WebADF. This folder contains images, JavaScript libraries and stylesheets used by the ESRI web controls. The web mapping application must have access to these files to function properly. If you deploy a web mapping application to a new server, these files must be made available by installing the ESRI ADF, either by installing the ADF Runtime or the ADF from the ArcGIS Server or ArcIMS CD. File-based websites using the built-in Visual Studio web server ("Cassini") may also have issues if the common folder is not accessible.
Default.aspx is the main mapping page in the web application. It displays by default when the application opens. It contains web controls to display a map along with related items, such as a table of contents, an overview map, and tools to interact with the map.
This page also has code for communicating with the server, such as for obtaining map image tiles. The page communicates with the page without refreshing the entire web page. It does this with a technique known as callbacks. This allows sending messages to the server and displaying the result within just the relevant section of the page. For example, the page manages callbacks when the user clicks on the map with the Identify tool, in which the information is obtained and displayed in the Task Results panel without a full page postback.
The default.aspx page contains a set of web controls and
formatting elements. In design view in Visual Studio 2005, the application
resembles the following:
The web mapping page uses a combination of panel controls, div elements and
tables to format the page. At the highest level, the page is divided into three
ASP.NET panel controls.
The default.aspx page contains a number of controls for displaying and interacting with map information. These include (bold = ESRI Web ADF controls):

Themes are a new feature in ASP.NET 2.0. A theme defines the look of pages and controls across the entire site. Themes allow easy switching between different looks and styles in the web applications. These changes can occur without affecting any of the code in the application. Themes consist of three types of files on disk:
Each theme is created as a separate subdirectory inside the App_Themes folder of
the web application.
The ESRI web mapping application contains a number of available themes. Manager allows you to set the theme. The theme name is stored in the web.config file. You can modify the theme by changing the theme attribute in the pages property:
<pages theme="Map_Viewer">
You can also modify existing themes or create your own themes for a customized look and feel to your application.
For more information on themes, see http://msdn2.microsoft.com/en-us/library/ykzx33wh.aspx.
SiteMap is another new feature in ASP.NET 2.0. It allows you to define website structure and relationships between pages. A typical use is to show "breadcrumb" navigation, where a user drills down into subsections of a website. The web mapping application uses a SiteMap to display hyperlinks to other web pages. The Manager application allows you to define these links. For example, you might add a hyperlink to the home page of your organization.
To use a SiteMap, we set up several items in the website. First, we define the links in a file called Web.sitemap. You will find this file in the main web application directory. The default sitemap links if you do not change them are:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="~/Default.aspx" title="Map Viewer" description="Map Viewer">
<siteMapNode url="http://www.esri.com" title="ESRI" description="ESRI" />
<siteMapNode url="http://support.esri.com" title="ESRI Support Center" description="ESRI Support Center" />
<siteMapNode url="Help/Default.htm" title="Help" description="Help" />
</siteMapNode>
</siteMap>
Second, a SiteMapDataSource control is added to the page. In source view of the web mapping application, you will find this control inside the LinkBar panel following the Toolbar control. It appears similar to the following:
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false" SiteMapProvider="AspnetXmlSiteMapProvider" />
Third, a Menu control is added to the page, and its DataSourceID is set to the SiteMapDataSource just added. This binds the site map's data to the menu control.
<asp:Menu ID="TitleMenu" runat="server" DataSourceID="SiteMapDataSource1" BackColor="Transparent"
Orientation="Horizontal" Font-Size="8pt" OnDataBound="TitleMenu_DataBound" SkinID="TaskBarSkin" Target="_Blank">
<StaticMenuItemStyle ItemSpacing="4px" />
</asp:Menu>
This displays the links in the browser, which the user can click on to navigate:

The web mapping application uses JavaScript to perform many client-side functions, such as map-click interaction and retrieving data from the server via callbacks. JavaScript library files may be retrieved from the server in one of three ways:
The ESRI web controls that use JavaScript resources have two properties that determine where the resources are drawn from:
The toolbar in the web mapping application template includes both standard and custom tools. The standard tools are: zoom in, zoom out, pan, and full extent. The custom tools are: identify, measure, and magnifier. Standard tools may be added using the ToolbarItems property dialog in Visual Studio. The three custom tools all act using client-side JavaScript functions. These settings may be observed in the ToolbarItems property dialog.
For more information on the toolbar, see the Toolbar control discussion. For information on creating custom tools, see Creating custom tools and commands.
Tasks are focused units of work that are packaged into components. These components may be added to the web mapping application via the Task framework. Typically, you add the task to the Task Manager control that is already in the application. The task component interacts with the map or other data, and generates results. Those results are typically displayed in the TaskResults web control.
Tasks included with the Web ADF are: Editing, FindAddress, FindPlace, Geoprocessing, QueryAttributes, and SearchAttributes. Some tasks work only with certain data source. For example, the Editing task only works with ArcGIS Server Local data sources, and requires that the data layers be in an ArcSDE geodatabase. For more information on standard tasks, see Configuring tasks in the ArcGIS Server Help, or see the ArcIMS Manager Help, under the topic "Configuring Tasks".
For information about creating custom tasks, see Working with Tasks. More information may also be available online at http://edn.esri.com.
The web mapping application includes a Measure function that has some similarities to a task, although it uses a different approach. The Measure function is opened via a toolbar item, and displays in a floating panel. It allows users to measure distance and area on the map.
This walkthrough shows how to create a custom tool and add it to the web mapping application. This tool will allow the user to click on the map to add a graphic point. To accomplish this customization, do three types of steps. First, we add a graphics layer to the MapResourceManager control. Second, we create a class library that contains the code for the tool implementation. Third, we add the tool to the Toolbar control and use the class library we created.
![]() |
![]() |
![]() |
using ESRI.ArcGIS.ADF.Web.DataSources; using ESRI.ArcGIS.ADF.Web.DataSources.Graphics; using ESRI.ArcGIS.ADF.Web.Display.Graphics; using ESRI.ArcGIS.ADF.Web.Display.Symbol; using ESRI.ArcGIS.ADF.Web.Geometry; using ESRI.ArcGIS.ADF.Web.UI.WebControls; using ESRI.ArcGIS.ADF.Web.UI.WebControls.Tools;[VB]
Imports ESRI.ArcGIS.ADF.Web.DataSources Imports ESRI.ArcGIS.ADF.Web.DataSources.Graphics Imports ESRI.ArcGIS.ADF.Web.Display.Graphics imports ESRI.ArcGIS.ADF.Web.Display.Symbol Imports ESRI.ArcGIS.ADF.Web.Geometry Imports ESRI.ArcGIS.ADF.Web.UI.WebControls Imports ESRI.ArcGIS.ADF.Web.UI.WebControls.Tools
public class GraphicPointTool: IMapServerToolAction
{
void IMapServerToolAction.ServerAction(ToolEventArgs args)
{
}
}
[VB]
Public Class GraphicPointTool
Implements IMapServerToolAction
Public Sub ServerAction(ByVal args As ToolEventArgs) Implements IMapServerToolAction.ServerAction
End Sub
End Class
// Get a reference to the map from the method argument
Map map = (Map)args.Control;
// Get the point the user clicked from the method argument
PointEventArgs pea = (PointEventArgs)args;
System.Drawing.Point screen_point = pea.ScreenPoint;
[VB]
' Get a reference to the map from the method argument
Dim map As Map = CType(args.Control, Map)
' Get the point the user clicked from the method argument
Dim pea As PointEventArgs = CType(args, PointEventArgs)
Dim screen_point As System.Drawing.Point = pea.ScreenPoint
ESRI.ArcGIS.ADF.Web.Geometry.Point
point; point = ESRI.ArcGIS.ADF.Web.Geometry.Point.ToMapPoint(screen_point.X,
screen_point.Y, map.Extent, (int)map.Width.Value, (int)map.Height.Value);
[VB]
Dim point As ESRI.ArcGIS.ADF.Web.Geometry.Point
point = ESRI.ArcGIS.ADF.Web.Geometry.Point.ToMapPoint(screen_point.X, _
screen_point.Y, map.Extent, CInt(map.Width.Value), CInt(map.Height.Value))
ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource gResource = null;
// Find the GraphicsLayer resource added to the MapResourceManager
foreach (IGISFunctionality gFunc in map.GetFunctionalities())
{
if (gFunc.Resource is ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource)
{
gResource = (MapResource)gFunc.Resource;
}
}
// Find the ElementGraphicsLayer in the graphics resource just found
ElementGraphicsLayer gLayer = null;
foreach (System.Data.DataTable dt in gResource.Graphics.Tables)
{
if (dt is ElementGraphicsLayer}
{
gLayer = (ElementGraphicsLayer)dt;
}
}
// ElementGraphicsLayer will not exist first time a point is added--create it now
if (gLayer == null)
{
gLayer = new ElementGraphicsLayer();
gResource.Graphics.Tables.Add(gLayer);
}
[VB]
Dim gResource As ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource = Nothing
' Find the GraphicsLayer resource added to the MapResourceManager
For Each gFunc As igisfunctionality In map.GetFunctionalities()
If TypeOf gFunc.Resource Is ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource Then
gResource = CType(gFunc.Resource, MapResource)
End If
Next
' Find the ElementGraphicsLayer in the graphics resource just found
Dim gLayer As ElementGraphicsLayer = Nothing
For Each dt As System.Data.DataTable In gResource.Graphics.Tables
If TypeOf dt Is ElementGraphicsLayer Then
gLayer = CType(dt, ElementGraphicsLayer)
End If
Next
' ElementGraphicsLayer will not exist first time a point is added--create it now
If gLayer Is Nothing Then
gLayer = New ElementGraphicsLayer()
gResource.Graphics.Tables.Add(gLayer)
End If
// Create the symbology for the point
SimpleMarkerSymbol sms = new SimpleMarkerSymbol(Drawing.Color.Red, 20, MarkerSymbolType.Cross);
// Create a graphic element to hold the point and its symbology
GraphicElement ge = new GraphicElement(point, sms);
// Add the graphic element to the graphics layer
gLayer.Add(ge);
[VB]
' Create the symbology for the point
Dim sms As New SimpleMarkerSymbol(Drawing.Color.Red, 20, MarkerSymbolType.Cross)
' Create a graphic element to hold the point and its symbology
Dim ge As New GraphicElement(point, sms)
' Add the graphic element to the graphics layer
gLayer.Add(ge)
if (map.ImageBlendingMode == ImageBlendingMode.Browser)
{
map.RefreshResource(gResource.Name);
}
else
{
map.Refresh();
}
[VB]
If map.ImageBlendingMode = ImageBlendingMode.Browser Then
map.RefreshResource(gResource.Name)
Else
map.Refresh()
End If
The flow in this custom tool is summarized in the graphic below. For more information on callback processing, see AJAX and the ASP.NET 2.0 Callback Framework.

For more examples of adding graphics to the map page, see the samples Common_AddGraphics and ArcGIS_AddGraphics in the developer kit samples.