ESRI.ArcGIS.ADF.Web.DataSources
SaveState Method
See Also  Example Send Feedback
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.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2011 All Rights Reserved.