ViewState V1.0 F1.7


File Name: Server_ASPListItemCollection.asp OR ASPFramework.ViewState
Class Name: Always use New_ViewStateObject() which will wrap the appropriate implementation (depending on the mode: ASP or COM)

Overview
Used to wrap a XML that is used to store the state of the WebControls in between request. The Page object makes use of this class and also some helper functions (see below) to persist state data in a hierarchycal fashion.  This object can also be used to store Key-Value pairs of data.

The Page object makes use of an instance of this object to store the viewstate and also uses another instance to store Client Scripts. The Page object has a set of helper functions listed below. These functions are used to create a hierarchy of controls within the ViewState and is and should only be used by the Page object.

  • GetSection(SectionName,Node)
  • GetSectionEx(SectionName,Node,IsNewSection)
  • WriteProperty(Name,Value,Node)
  • ReadProperty(Name,Node)

    Public Constructors
    New_ViewStateObject() Default constructor and is used to wrap the real implementation.

    Public Properties
    Count Int Gets the number of Items in the collection.

    Public Methods
    LoadViewState(xml) Loads an XML with viewstate data.
    LoadViewStateBase64(xmlBase64,bolIsCompressed) Loads an XML with viewstate that is Base64 encoded. bolIsCompressed returns true if the viewstate was compressed.
    GetViewState Gets the XML of the viewstate.
    GetViewStateBase64(lngCompressFactor, ByRef bolIsCompressed) Gets the XML of the viewstate encoded in Base64.
    Add(Name,value) Adds a node to the ViewState with name <name> and value <value>. If the node already exists it will overwrite the value.
    Remove(index) Remove the node at position <index>
    RemoveByName(Name) Remove the node with the name <name>
    GetValueByIndex(index) Get the value of the node at position <index>
    SetValueByIndex(ByVal index, ByVal value) Sets the value of the mode at position <index>
    GetValue(Name) Gets the value of the node with name <name>
    SetValue(Name, value) Sets the value of the node with name <name>
    HasKey(Name) Returns true if the viewstate has a Key <key>

    Public Events
    -- --

    Protected Properties
    -- -- --

    Protected Methods
    GetNodeByName(Name) Gets a XML DOM node with name <Name>

    Protected Events
    -- --