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

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

Control.ChildControlsCreated プロパティ

サーバー コントロールの子コントロール作成されたかどうかを示す値を取得します

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

Protected Property ChildControlsCreated As
 Boolean
Dim value As Boolean

value = Me.ChildControlsCreated

Me.ChildControlsCreated = value
protected bool ChildControlsCreated { get;
 set; }
protected:
property bool ChildControlsCreated {
    bool get ();
    void set (bool value);
}
/** @property */
protected boolean get_ChildControlsCreated ()

/** @property */
protected void set_ChildControlsCreated (boolean
 value)
protected function get ChildControlsCreated
 () : boolean

protected function set ChildControlsCreated
 (value : boolean)

プロパティ
コントロール作成され場合trueそれ以外場合false

使用例使用例

OnDataBinding メソッドオーバーライドの例を次に示します。再びデータ連結発生するまで子コントロール作成されないようにするために、RepeaterItem オブジェクト作成しコントロールの ControlCollection オブジェクト追加すると、ChildControlsCreated プロパティtrue設定されます。

' Override to create the repeated items from the DataSource.
Protected Overrides Sub
 OnDataBinding(E As EventArgs)
    MyBase.OnDataBinding(e)

    If Not DataSource Is
 Nothing
        ' Clear any existing child controls.
        Controls.Clear()
        ' Clear any previous view state for the existing child controls.
        ClearChildViewState()

        ' Iterate over the DataSource, creating a new item for each
 data item.
        Dim DataEnum As IEnumerator = DataSource.GetEnumerator()
        Dim I As Integer
 = 0
        Do While (DataEnum.MoveNext())

            ' Create an item.
            Dim Item As RepeaterItemVB = New
 RepeaterItemVB(I, DataEnum.Current)
            ' Initialize the item from the template.
            ItemTemplate.InstantiateIn(Item)
            ' Add the item to the ControlCollection.
            Controls.Add(Item)

            I = I + 1
        Loop

        ' Prevent child controls from being created again.
        ChildControlsCreated = true
        ' Store the number of items created in view state for postback
 scenarios.
        ViewState("NumItems") = I
    End If
End Sub
// Override to create the repeated items from the DataSource.
protected override void OnDataBinding(EventArgs
 e) {
    base.OnDataBinding(e);

    if (DataSource != null) {
        // Clear any existing child controls.
        Controls.Clear();
        // Clear any previous view state for the existing child controls.
        ClearChildViewState();

        // Iterate over the DataSource, creating a new item for each
 data item.
        IEnumerator dataEnum = DataSource.GetEnumerator();
        int i = 0;
        while(dataEnum.MoveNext()) {

            // Create an item.
            RepeaterItem item = new RepeaterItem(i, dataEnum.Current);
            // Initialize the item from the template.
            ItemTemplate.InstantiateIn(item);
            // Add the item to the ControlCollection.
            Controls.Add(item);

            i++;
        }

        // Prevent child controls from being created again.
        ChildControlsCreated = true;
        // Store the number of items created in view state for postback
 scenarios.
        ViewState["NumItems"] = i;
    }
}
// Override to create the repeated items from the DataSource.
protected void OnDataBinding(EventArgs e)
{
    super.OnDataBinding(e);

    if (get_DataSource() != null) {
        // Clear any existing child controls.
        get_Controls().Clear();
        // Clear any previous view state for the existing child controls.
        ClearChildViewState();
        // Iterate over the DataSource, creating a new item for each
        // data item.
        IEnumerator dataEnum = get_DataSource().GetEnumerator();
        int i = 0;
        while (dataEnum.MoveNext()) {
            // Create an item.
            RepeaterItem item = new RepeaterItem(i, dataEnum.get_Current());
            // Initialize the item from the template.
            get_ItemTemplate().InstantiateIn(item);
            // Add the item to the ControlCollection.
            get_Controls().Add(item);
            i++;
        }
        // Prevent child controls from being created again.
        set_ChildControlsCreated(true);
        // Store the number of items created in view state for postback
        // scenarios.
        get_ViewState().set_Item("NumItems", (Int32)i);
    }
} //OnDataBinding
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からControl.ChildControlsCreated プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からControl.ChildControlsCreated プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からControl.ChildControlsCreated プロパティ を検索

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS