ESRI.ArcGIS.ADF.IMS
ID Property
See Also  Example
ESRI.ArcGIS.ADF.IMS.Carto.Layer Namespace > Layer Class : ID Property




Gets or sets the Layer ID.

Syntax

Visual Basic (Declaration) 
Public Overridable Property ID As String
Visual Basic (Usage)Copy Code
Dim instance As Layer
Dim value As String
 
instance.ID = value
 
value = instance.ID
C# 
public virtual string ID {get; set;}

Example

This example prints the layer ID along with the layer name to a label web control. It assumes an existing MapView object.
C#Copy Code
FeatureLayer citiesLayer = (FeatureLayer) mapView.Layers.FindByName("Cities"); 

Label1.Text = citiesLayer.Name + " has an ID of " + citiesLayer.ID; 

    
Visual BasicCopy Code
Dim citiesLayer As FeatureLayer = CType(mapView.Layers.FindByName("Cities"), FeatureLayer)

Label1.Text = citiesLayer.Name + " has an ID of " + citiesLayer.ID

Remarks

This property identifies the layer to the server. Each layer ID must be unique within the LayerCollection. The ID can be any combination of alpha and numeric characters. Do not use spaces in the ID. Do not use any special characters.

Set IDs only for layers you create as selection layers, dynamic layers, or acetate layers. Do not change the ID for layers in the map service. If you change the ID of a layer in the map service, the server will ignore any other settings for the layer, such as visibility, renderer or filter.

See Also

© 2010 All Rights Reserved.