ArcGIS API for WPF - Library Reference
DisableClientCaching Property
See Also  Example Send comments on this topic
ESRI.ArcGIS.Client Namespace > ArcGISDynamicMapServiceLayer Class : DisableClientCaching Property

Disables caching an ArcGISDynamicMapServiceLayer image on the client.

Syntax

Visual Basic (Declaration) 
Public Property DisableClientCaching As Boolean
C# 
public bool DisableClientCaching {get; set;}

Example

XAMLCopy Code
<esri:Map Background="White" HorizontalAlignment="Left" Margin="5,5,5,5" Name="Map1" 
             VerticalAlignment="Top" Height="200" Width="400" BorderThickness="5" BorderBrush="#FF30EBEB">
            
       <!-- Set the DisableClientCaching to true. The default value for the service is false. -->
       <esri:ArcGISDynamicMapServiceLayer 
             Url="http://sampleserver1.arcgisonline.com:80/arcgis/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer" 
             DisableClientCaching="True" />
             
   </esri:Map>
C#Copy Code
private void ArcGISDynamicMapServiceLayer_Initialized(object sender, System.EventArgs e)
{
    // The myArcGISDynamicMapServiceLayer (an ArcGISDynamicServiceLayer object) and TextBlock_DisableClientCaching
    // (a TextBlock object) were defined previously in the XAML or code-behind.
                 
    // Get the first layer in the LayerInfo collection. 
    ArcGISDynamicMapServiceLayer myArcGISDynamicMapServiceLayer = (ArcGISDynamicMapServiceLayer)Map1.Layers[0];
    
    // DisableClientCaching (Read/Write).
    
    // Set the .DisableClientCaching to true. The default value for the service is false.
    myArcGISDynamicMapServiceLayer.DisableClientCaching = true;
            
    // Get the .DisableClientCashing property.
    TextBlock_DisableClientCaching.Text = myArcGISDynamicMapServiceLayer.DisableClientCaching.ToString();
}
VB.NETCopy Code
Private Sub ArcGISDynamicMapServiceLayer_Initialized(ByVal sender As System.Object, ByVal e As System.EventArgs)
    ' The myArcGISDynamicMapServiceLayer (an ArcGISDynamicServiceLayer object) and TextBlock_DisableClientCaching
    ' (a TextBlock object) were defined previously in the XAML or code-behind.
    
    ' Get the first layer in the LayerInfo collection. 
    Dim myArcGISDynamicMapServiceLayer As ArcGISDynamicMapServiceLayer = Map1.Layers.Item(0)
    
    ' DisableClientCaching (Read/Write).
    
    ' Set the .DisableClientCaching to true. The default value for the service is false.
    myArcGISDynamicMapServiceLayer.DisableClientCaching = True
    
    ' Get the .DisableClientCashing property.
    TextBlock_DisableClientCaching.Text = myArcGISDynamicMapServiceLayer.DisableClientCaching.ToString
End Sub

Remarks

The default value is false. If true, adds a timestamp parameter ("_ts") to the REST request to prevent loading a map image from the browser's cache.

Requirements

Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© ESRI, Inc. All Rights Reserved.