ESRI.ArcGIS.ADF.Web.DataSources
SaveState Method
See Also  Example
ESRI.ArcGIS.ADF.Web.DataSources Namespace > IGISResource Interface : SaveState Method




Save the state of the GIS resource.

Syntax

Visual Basic (Declaration) 
Sub SaveState() 
Visual Basic (Usage)Copy Code
Dim instance As IGISResource
 
instance.SaveState()
C# 
void SaveState()

Example

The GIS resource instance is stored in the hashtable managed by its GIS data source. The key is a user defined value to uniquely identify a resource. The key should be unique for resource definition in case the resource definition changes at runtime.
C#Copy Code
public virtual void SaveState() 



    if (dataSource == null) return; 

    if (dataSource.State == null) return; 

    dataSource.State[key] = this; 



         

internal string key 



    get 

    {  

      return string.Format("{0}:{1}:{2}", this.GetType(), Name, ResourceDefinition);  

    } 



    

Remarks

The SaveState method is often used to save an instance of the GIS resource in state. If a resource is managed by a resource manager control, the SaveViewState event during the page lifecycle will call SaveState on the resource. Developers should define a custom key to identify the GIS resource value.

See Also

© 2010 All Rights Reserved.