StateItem.Value プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > StateItem.Value プロパティの意味・解説 

StateItem.Value プロパティ

StateBag オブジェクト格納されている StateItem オブジェクトの値を取得または設定します

名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)
構文構文

使用例使用例

StateItem クラスValue プロパティと IsDirty プロパティ使用してシンプルなカスタム ASP.NET サーバー コントロール クラス (FirstCustomControl) の状態を保存する方法次のコード例示しますページサーバーポストされると、IsDirty プロパティによって、項目が変更されたかどうかがチェックされます。この状態の値は、Value プロパティから取得され表示されます。

    ' Create a function that iterates through the view-state
    ' values stored for this class and returns the
    ' results as a string.
    Public Function EnumerateViewState() As
 String
        Dim keyName, keyValue As String
        Dim result As String
 = [String].Empty
        Dim myStateItem As StateItem
        Dim myDictionaryEnumerator As IDictionaryEnumerator
 = _viewstate.GetEnumerator()
        While myDictionaryEnumerator.MoveNext()
            keyName = CStr(myDictionaryEnumerator.Key)
            myStateItem = CType(myDictionaryEnumerator.Value, StateItem)
            keyValue = CStr(myStateItem.Value)
            result = result + "<br>ViewState["
 + keyName + "] = " + keyValue
        End While
        Return result
    End Function 'EnumerateViewState
End Class 'MyItem 
// Create a function that iterates through the view-state
// values stored for this class and returns the
// results as a string.
public string EnumerateViewState()
{
    string keyName, keyValue;
    string result = String.Empty;
    StateItem myStateItem;
    IDictionaryEnumerator myDictionaryEnumerator = _viewstate.GetEnumerator();
    while (myDictionaryEnumerator.MoveNext())
    {
        keyName = (string)myDictionaryEnumerator.Key;
        myStateItem = (StateItem)myDictionaryEnumerator.Value;
        keyValue = (string)myStateItem.Value;
        result = result + "<br>ViewState[" + keyName + "] =
 " + keyValue;
    }
    return result;
}
// Create a function that iterates through the view-state
// values stored for this class and returns the
// results as a string.
public String EnumerateViewState()
{
    String keyName, keyValue;
    String result = "";
    StateItem myStateItem;
    IDictionaryEnumerator myDictionaryEnumerator = 
        _viewState.GetEnumerator();
    while (myDictionaryEnumerator.MoveNext()) {
        keyName = (String)myDictionaryEnumerator.get_Key();
        myStateItem = (StateItem) myDictionaryEnumerator.get_Value();
        keyValue = (String)myStateItem.get_Value();
        result = result + "<br>ViewState[" + keyName + "] =
 " + keyValue;
    }
    return result;
} //EnumerateViewState
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
StateItem クラス
StateItem メンバ
System.Web.UI 名前空間
StateBag クラス
Control.ViewState プロパティ



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

StateItem.Value プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



StateItem.Value プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS