This documentation is archived and is not being maintained.
StateBag.GetEnumerator Method
.NET Framework 1.1
Returns an enumerator that iterates over all the key/value pairs of the StateItem objects stored in the StateBag.
[Visual Basic] Public Overridable Function GetEnumerator() As IDictionaryEnumerator _ Implements IDictionary.GetEnumerator [C#] public virtual IDictionaryEnumerator GetEnumerator(); [C++] public: virtual IDictionaryEnumerator* GetEnumerator(); [JScript] public function GetEnumerator() : IDictionaryEnumerator;
Return Value
The enumerator to iterate through the state bag.
Implements
Example
[Visual Basic] ' Create a StateBag object to contain the view state ' associated with the custom control named myControl. Use the ' StateBag.GetEnumerator method to create an ' IDictionaryEnumerator named myDictionaryEnumerator. Dim ctlOne As New ctlViewState1() Dim myStateBag As New StateBag() myStateBag = ctlOne.GetState() Dim myDictionaryEnumerator As IDictionaryEnumerator = myStateBag.GetEnumerator() [C#] // Create a StateBag object to contain the view state // associated with the custom control named myControl. Use the // StateBag.GetEnumerator method to create an // IDictionaryEnumerator named myDictionaryEnumerator. ctlViewState1 ctlOne = new ctlViewState1(); StateBag myStateBag = new StateBag(); myStateBag = ctlOne.GetState(); IDictionaryEnumerator myDictionaryEnumerator = myStateBag.GetEnumerator();
[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family
See Also
StateBag Class | StateBag Members | System.Web.UI Namespace | IDictionaryEnumerator
Show: