DataBoundControl クラス

定義

リスト形式または表形式でデータを表示するすべての ASP.NET バージョン 2.0 データ バインド コントロールの基本クラスとして機能します。

public ref class DataBoundControl abstract : System::Web::UI::WebControls::BaseDataBoundControl
public abstract class DataBoundControl : System.Web.UI.WebControls.BaseDataBoundControl
type DataBoundControl = class
    inherit BaseDataBoundControl
Public MustInherit Class DataBoundControl
Inherits BaseDataBoundControl
継承
派生

次のコード例では、 DataBoundControl クラスからクラスを派生して、カスタム データ バインド コントロールを作成する方法を示します。 TextBoxSet コントロールは、関連付けられているデータ ソース コントロールから取得されたデータ項目ごとにTextBox コントロールを作成し、実行時にデータ項目の値にバインドします。 Render メソッドの現在の実装では、TextBox コントロールが順序なしリストとしてレンダリングされます。

using System;
using System.Collections;
using System.ComponentModel;
using System.Security.Permissions;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Samples.AspNet.Controls.CS {

    [AspNetHostingPermission(SecurityAction.Demand, 
        Level=AspNetHostingPermissionLevel.Minimal)]
    [AspNetHostingPermission(SecurityAction.InheritanceDemand, 
        Level=AspNetHostingPermissionLevel.Minimal)]
    public class TextBoxSet : DataBoundControl {

        private IList alBoxSet;
        public IList BoxSet {
            get {
                if (null == alBoxSet) {
                     alBoxSet = new ArrayList();
                }
                return alBoxSet;                
            }                    
        }
        public string DataTextField {
            get {
                object o = ViewState["DataTextField"];
                return((o == null) ? string.Empty : (string)o);
            }
            set {
                ViewState["DataTextField"] = value;
                if (Initialized) {
                    OnDataPropertyChanged();
                }
            }
        }
        protected override void PerformSelect() {            

           // Call OnDataBinding here if bound to a data source using the
           // DataSource property (instead of a DataSourceID), because the
           // databinding statement is evaluated before the call to GetData.       
            if (!IsBoundUsingDataSourceID) {
                OnDataBinding(EventArgs.Empty);
            }            
            
            // The GetData method retrieves the DataSourceView object from  
            // the IDataSource associated with the data-bound control.            
            GetData().Select(CreateDataSourceSelectArguments(), 
                OnDataSourceViewSelectCallback);
            
            // The PerformDataBinding method has completed.
            RequiresDataBinding = false;
            MarkAsDataBound();
            
            // Raise the DataBound event.
            OnDataBound(EventArgs.Empty);
        }
        private void OnDataSourceViewSelectCallback(IEnumerable retrievedData) {
        
           // Call OnDataBinding only if it has not already been 
           // called in the PerformSelect method.
            if (IsBoundUsingDataSourceID) {
                OnDataBinding(EventArgs.Empty);
            }
            // The PerformDataBinding method binds the data in the  
            // retrievedData collection to elements of the data-bound control.
            PerformDataBinding(retrievedData);                                    
        }
        protected override void PerformDataBinding(IEnumerable retrievedData) {
            base.PerformDataBinding(retrievedData);

            // If the data is retrieved from an IDataSource as an 
            // IEnumerable collection, attempt to bind its values to a 
            // set of TextBox controls.
            if (retrievedData != null) {

                foreach (object dataItem in retrievedData) {
                    
                    TextBox box = new TextBox();
                    
                    // The dataItem is not just a string, but potentially
                    // a System.Data.DataRowView or some other container. 
                    // If DataTextField is set, use it to determine which 
                    // field to render. Otherwise, use the first field.                    
                    if (DataTextField.Length > 0) {
                        box.Text = DataBinder.GetPropertyValue(dataItem, 
                            DataTextField, null);
                    }
                    else {
                        PropertyDescriptorCollection props = 
                            TypeDescriptor.GetProperties(dataItem);

                        // Set the "default" value of the TextBox.
                        box.Text = String.Empty;
                        
                        // Set the true data-bound value of the TextBox,
                        // if possible.
                        if (props.Count >= 1) {                        
                            if (null != props[0].GetValue(dataItem)) {
                                box.Text = props[0].GetValue(dataItem).ToString();
                            }
                        }
                    }                                        
                    
                    BoxSet.Add(box);
                }
            }
        }
        protected override void Render(HtmlTextWriter writer) {

            // Render nothing if the control is empty.            
            if (BoxSet.Count <= 0) {
                return;
            }

            // Make sure the control is declared in a form tag 
            // with runat=server.
            if (Page != null) {
                Page.VerifyRenderingInServerForm(this);
            }
            
            // For this example, render the BoxSet as 
            // an unordered list of TextBox controls.            
            writer.RenderBeginTag(HtmlTextWriterTag.Ul);

            foreach (object item in BoxSet) {
                 
                TextBox box = (TextBox) item;
                
                // Write each element as 
                // <li><input type="text" value="string"><input/></li>
                
                writer.WriteBeginTag("li");
                writer.Write(">");
                writer.WriteBeginTag("input");
                writer.WriteAttribute("type", "text");
                writer.WriteAttribute("value", box.Text);
                writer.Write(">");
                writer.WriteEndTag("input");
                writer.WriteEndTag("li");
            }            

            writer.RenderEndTag();                       
        }
    }
}
Imports System.Collections
Imports System.ComponentModel
Imports System.Security.Permissions
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls

Namespace Samples.AspNet.Controls.VB

<AspNetHostingPermission(SecurityAction.Demand, _
    Level:=AspNetHostingPermissionLevel.Minimal), _
    AspNetHostingPermission(SecurityAction.InheritanceDemand, _
    Level:=AspNetHostingPermissionLevel.Minimal)> _
  Public Class TextBoxSet
    Inherits DataBoundControl

    Private alBoxSet As IList

    Public ReadOnly Property BoxSet() As IList
        Get
            If alBoxSet Is Nothing Then
                alBoxSet = New ArrayList()
            End If
            Return alBoxSet
        End Get
    End Property

    Public Property DataTextField() As String
        Get
            Dim o As Object = ViewState("DataTextField")
            If o Is Nothing Then
                Return String.Empty
            Else
                Return CStr(o)
            End If
        End Get
        Set(ByVal value As String)
            ViewState("DataTextField") = value
            If (Initialized) Then
                OnDataPropertyChanged()
            End If
        End Set
    End Property

    Protected Overrides Sub PerformSelect()

        ' Call OnDataBinding here if bound to a data source using the 
        ' DataSource property (instead of a DataSourceID) because the 
        ' data-binding statement is evaluated before the call to GetData.
        If Not IsBoundUsingDataSourceID Then
            OnDataBinding(EventArgs.Empty)
        End If

        ' The GetData method retrieves the DataSourceView object from the 
        ' IDataSource associated with the data-bound control.            
        GetData().Select(CreateDataSourceSelectArguments(), _
            AddressOf OnDataSourceViewSelectCallback)

        ' The PerformDataBinding method has completed.
        RequiresDataBinding = False
        MarkAsDataBound()

        ' Raise the DataBound event.
            OnDataBound(EventArgs.Empty)

    End Sub

    Private Sub OnDataSourceViewSelectCallback(ByVal retrievedData As IEnumerable)

        ' Call OnDataBinding only if it has not already
        ' been called in the PerformSelect method.
        If IsBoundUsingDataSourceID Then
            OnDataBinding(EventArgs.Empty)
        End If
        ' The PerformDataBinding method binds the data in the retrievedData 
        ' collection to elements of the data-bound control.
        PerformDataBinding(retrievedData)

    End Sub

    Protected Overrides Sub PerformDataBinding(ByVal retrievedData As IEnumerable)
        MyBase.PerformDataBinding(retrievedData)

        ' If the data is retrieved from an IDataSource as an IEnumerable 
        ' collection, attempt to bind its values to a set of TextBox controls.
        If Not (retrievedData Is Nothing) Then

            Dim dataItem As Object
            For Each dataItem In retrievedData

                Dim box As New TextBox()

                ' The dataItem is not just a string, but potentially
                ' a System.Data.DataRowView or some other container. 
                ' If DataTextField is set, use it to determine which 
                ' field to render. Otherwise, use the first field.                    
                If DataTextField.Length > 0 Then
                    box.Text = DataBinder.GetPropertyValue( _
                    dataItem, DataTextField, Nothing)
                Else
                    Dim props As PropertyDescriptorCollection = _
                        TypeDescriptor.GetProperties(dataItem)

                    ' Set the "default" value of the TextBox.
                    box.Text = String.Empty

                    ' Set the true data-bound value of the TextBox,
                    ' if possible.
                    If props.Count >= 1 Then
                        If props(0).GetValue(dataItem) IsNot Nothing Then
                            box.Text = props(0).GetValue(dataItem).ToString()
                        End If
                    End If
                End If

                BoxSet.Add(box)
            Next dataItem
        End If

    End Sub

    Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)

        ' Render nothing if the control is empty.            
        If BoxSet.Count <= 0 Then
            Return
        End If

        ' Make sure the control is declared in a form tag with runat=server.
        If Not (Page Is Nothing) Then
            Page.VerifyRenderingInServerForm(Me)
        End If

        ' For this example, render the BoxSet as 
        ' an unordered list of TextBox controls.            
        writer.RenderBeginTag(HtmlTextWriterTag.Ul)

        Dim item As Object
        For Each item In BoxSet

            Dim box As TextBox = CType(item, TextBox)

            ' Write each element as 
            ' <li><input type="text" value="string"><input/></li>
            writer.WriteBeginTag("li")
            writer.Write(">")
            writer.WriteBeginTag("input")
            writer.WriteAttribute("type", "text")
            writer.WriteAttribute("value", box.Text)
            writer.Write(">")
            writer.WriteEndTag("input")
            writer.WriteEndTag("li")
        Next item

        writer.RenderEndTag()

    End Sub
    End Class
End Namespace

次のコード例は、前の例で定義した TextBoxSet コントロールを使用し、 AccessDataSource コントロールにバインドする方法を示しています。

<%@Page language="c#" %>
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.Controls.CS" 
    Assembly="Samples.AspNet.Controls.CS" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head>
    <title>TextBoxSet Data-Bound Control  - C# Example</title>
  </head>

  <body>
    <form id="Form1" method="post" runat="server">

        <aspSample:textboxset
          id="TextBoxSet1"
          runat="server"
          datasourceid="AccessDataSource1" />

        <asp:accessdatasource
          id="AccessDataSource1"
          runat="server"
          datafile="Northwind.mdb"
          selectcommand="SELECT lastname FROM Employees" />
          
    </form>
  </body>
</html>
<%@Page language="VB" %>
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.Controls.VB" 
    Assembly="Samples.AspNet.Controls.VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head>
    <title>TextBoxSet Data-Bound Control - VB Example</title>
  </head>

  <body>
    <form id="Form1" method="post" runat="server">

        <aspSample:textboxset
          id="TextBoxSet1"
          runat="server"
          datasourceid="AccessDataSource1" />

        <asp:accessdatasource
          id="AccessDataSource1"
          runat="server"
          datafile="Northwind.mdb"
          selectcommand="SELECT lastname FROM Employees" />
          
    </form>
  </body>
</html>

注釈

DataBoundControl クラスは、ASP.NET データ ソース コントロールから表形式またはリスト スタイルのデータを取得し、コントロールのユーザー インターフェイス (UI) 要素を表示用のそのデータにバインドする ASP.NET コントロールに使用される基本クラスです。 GridViewDetailsViewFormViewなどの複合データ バインド コントロール、BulletedListCheckBoxListなどのリスト スタイルのデータ バインド コントロール、およびDataBoundControlから派生AdRotatorその他のコントロール。

ページ開発者は、 DataBoundControl クラスを直接使用しません。代わりに、このクラスから派生したコントロールを使用します。

コントロール開発者は、このクラスを拡張して、 IDataSource インターフェイスを実装するクラスと、 DataSourceControl および DataSourceView クラスから派生するクラスを操作するデータ バインド コントロールを作成します。 DataBoundControl クラスからクラスを派生させる場合は、PerformDataBinding メソッドをオーバーライドして、GetData メソッドによって取得されたデータにコントロールの UI 要素をバインドします。 ほとんどの場合、 PerformDataBinding メソッドは、派生クラスでオーバーライドする唯一のメソッドです。

ASP.NET 2.0 データ バインド コントロールの場合、PerformSelect メソッドは DataBind メソッドに相当し、実行時にデータをバインドするために呼び出されます。 PerformSelect メソッドは、GetDataメソッドとPerformDataBinding メソッドを呼び出します。

コンストラクター

名前 説明
DataBoundControl()

継承されたクラス インスタンスで使用する DataBoundControl クラスを初期化します。 このコンストラクターは、継承されたクラスによってのみ呼び出すことができます。

プロパティ

名前 説明
AccessKey

Web サーバー コントロールにすばやく移動できるアクセス キーを取得または設定します。

(継承元 WebControl)
Adapter

コントロールのブラウザー固有のアダプターを取得します。

(継承元 Control)
AppRelativeTemplateSourceDirectory

このコントロールを含む Page または UserControl オブジェクトのアプリケーション相対仮想ディレクトリを取得または設定します。

(継承元 Control)
Attributes

コントロールのプロパティに対応しない任意の属性のコレクションを取得します (レンダリングのみ)。

(継承元 WebControl)
BackColor

Web サーバー コントロールの背景色を取得または設定します。

(継承元 WebControl)
BindingContainer

このコントロールのデータ バインディングを含むコントロールを取得します。

(継承元 Control)
BorderColor

Web コントロールの境界線の色を取得または設定します。

(継承元 WebControl)
BorderStyle

Web サーバー コントロールの境界線スタイルを取得または設定します。

(継承元 WebControl)
BorderWidth

Web サーバー コントロールの境界線の幅を取得または設定します。

(継承元 WebControl)
ChildControlsCreated

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

(継承元 Control)
ClientID

ASP.NET によって生成される HTML マークアップのコントロール ID を取得します。

(継承元 Control)
ClientIDMode

ClientID プロパティの値を生成するために使用するアルゴリズムを取得または設定します。

(継承元 Control)
ClientIDSeparator

ClientID プロパティで使用される区切り文字を表す文字値を取得します。

(継承元 Control)
Context

現在の Web 要求のサーバー コントロールに関連付けられている HttpContext オブジェクトを取得します。

(継承元 Control)
Controls

UI 階層内の指定したサーバー コントロールの子コントロールを表す ControlCollection オブジェクトを取得します。

(継承元 Control)
ControlStyle

Web サーバー コントロールのスタイルを取得します。 このプロパティは、主にコントロール開発者によって使用されます。

(継承元 WebControl)
ControlStyleCreated

Style プロパティに対してControlStyle オブジェクトが作成されたかどうかを示す値を取得します。 このプロパティは、主にコントロール開発者によって使用されます。

(継承元 WebControl)
CssClass

クライアント上の Web サーバー コントロールによってレンダリングされるカスケード スタイル シート (CSS) クラスを取得または設定します。

(継承元 WebControl)
DataItemContainer

名前付けコンテナーが IDataItemContainerを実装する場合は、名前付けコンテナーへの参照を取得します。

(継承元 Control)
DataKeysContainer

名前付けコンテナーが IDataKeysControlを実装する場合は、名前付けコンテナーへの参照を取得します。

(継承元 Control)
DataMember

データ ソースに複数の個別のデータ項目リストが含まれている場合に、データ バインド コントロールがバインドするデータのリストの名前を取得または設定します。

DataSource

データ バインド コントロールがデータ項目のリストを取得する元のオブジェクトを取得または設定します。

(継承元 BaseDataBoundControl)
DataSourceID

データ バインド コントロールがデータ項目のリストを取得する元のコントロールの ID を取得または設定します。

DataSourceObject

オブジェクトのデータ コンテンツへのアクセスを提供する IDataSource インターフェイスを実装するオブジェクトを取得します。

DesignMode

コントロールがデザイン サーフェイスで使用されているかどうかを示す値を取得します。

(継承元 Control)
Enabled

Web サーバー コントロールが有効かどうかを示す値を取得または設定します。

(継承元 WebControl)
EnableTheming

テーマがこのコントロールに適用されるかどうかを示す値を取得または設定します。

(継承元 WebControl)
EnableViewState

サーバー コントロールがそのビューステートを保持するかどうか、およびそれに含まれる子コントロールのビューステートを要求側クライアントに保持するかどうかを示す値を取得または設定します。

(継承元 Control)
Events

コントロールのイベント ハンドラー デリゲートの一覧を取得します。 このプロパティは読み取り専用です。

(継承元 Control)
Font

Web サーバー コントロールに関連付けられているフォント プロパティを取得します。

(継承元 WebControl)
ForeColor

Web サーバー コントロールの前景色 (通常はテキストの色) を取得または設定します。

(継承元 WebControl)
HasAttributes

コントロールに属性が設定されているかどうかを示す値を取得します。

(継承元 WebControl)
HasChildViewState

現在のサーバー コントロールの子コントロールに保存されたビューステート設定があるかどうかを示す値を取得します。

(継承元 Control)
Height

Web サーバー コントロールの高さを取得または設定します。

(継承元 WebControl)
ID

サーバー コントロールに割り当てられたプログラム識別子を取得または設定します。

(継承元 Control)
IdSeparator

コントロール識別子を分離するために使用する文字を取得します。

(継承元 Control)
Initialized

データ バインド コントロールが初期化されているかどうかを示す値を取得します。

(継承元 BaseDataBoundControl)
IsBoundUsingDataSourceID

DataSourceID プロパティが設定されているかどうかを示す値を取得します。

(継承元 BaseDataBoundControl)
IsChildControlStateCleared

このコントロール内に含まれるコントロールがコントロールの状態を持っているかどうかを示す値を取得します。

(継承元 Control)
IsDataBindingAutomatic

データ バインディングが自動かどうかを示す値を取得します。

(継承元 BaseDataBoundControl)
IsEnabled

コントロールが有効かどうかを示す値を取得します。

(継承元 WebControl)
IsTrackingViewState

サーバー コントロールがビュー ステートへの変更を保存するかどうかを示す値を取得します。

(継承元 Control)
IsUsingModelBinders

モデル バインドが使用されているかどうかを示す値を取得します。

IsViewStateEnabled

このコントロールに対してビューステートが有効かどうかを示す値を取得します。

(継承元 Control)
ItemType

厳密に型指定されたデータ バインディングのデータ項目型の名前を取得または設定します。

LoadViewStateByID

インデックスの代わりに ID して、コントロールがビューステートの読み込みに関与するかどうかを示す値を取得します。

(継承元 Control)
NamingContainer

同じ ID プロパティ値を持つサーバー コントロール間で区別するための一意の名前空間を作成する、サーバー コントロールの名前付けコンテナーへの参照を取得します。

(継承元 Control)
Page

サーバー コントロールを含む Page インスタンスへの参照を取得します。

(継承元 Control)
Parent

ページ コントロール階層内のサーバー コントロールの親コントロールへの参照を取得します。

(継承元 Control)
RenderingCompatibility

レンダリングされた HTML と互換性のある ASP.NET バージョンを指定する値を取得します。

(継承元 Control)
RequiresDataBinding

DataBind() メソッドを呼び出す必要があるかどうかを示す値を取得または設定します。

(継承元 BaseDataBoundControl)
SelectArguments

データ ソース コントロールからデータを取得するときにデータ バインド コントロールが使用する DataSourceSelectArguments オブジェクトを取得します。

SelectMethod

データを読み取るために呼び出すメソッドの名前。

Site

デザイン サーフェイスにレンダリングされるときに、現在のコントロールをホストするコンテナーに関する情報を取得します。

(継承元 Control)
SkinID

コントロールに適用するスキンを取得または設定します。

(継承元 WebControl)
Style

Web サーバー コントロールの外部タグのスタイル属性としてレンダリングされるテキスト属性のコレクションを取得します。

(継承元 WebControl)
SupportsDisabledAttribute

コントロールのdisabled プロパティがIsEnabledされたときに、レンダリングされた HTML 要素のfalse属性を "無効" に設定する必要があるかどうかを示す値を取得します。

(継承元 BaseDataBoundControl)
TabIndex

Web サーバー コントロールのタブ インデックスを取得または設定します。

(継承元 WebControl)
TagKey

この Web サーバー コントロールに対応する HtmlTextWriterTag 値を取得します。 このプロパティは、主にコントロール開発者によって使用されます。

(継承元 WebControl)
TagName

コントロール タグの名前を取得します。 このプロパティは、主にコントロール開発者によって使用されます。

(継承元 WebControl)
TemplateControl

このコントロールを含むテンプレートへの参照を取得または設定します。

(継承元 Control)
TemplateSourceDirectory

現在のサーバー コントロールを含む Page または UserControl の仮想ディレクトリを取得します。

(継承元 Control)
ToolTip

マウス ポインターが Web サーバー コントロールの上に置いたときに表示されるテキストを取得または設定します。

(継承元 WebControl)
UniqueID

サーバー コントロールの階層的に修飾された一意の識別子を取得します。

(継承元 Control)
ValidateRequestMode

コントロールがブラウザーからのクライアント入力で潜在的に危険な値をチェックするかどうかを示す値を取得または設定します。

(継承元 Control)
ViewState

同じページに対する複数の要求にわたってサーバー コントロールのビューステートを保存および復元できる状態情報のディクショナリを取得します。

(継承元 Control)
ViewStateIgnoresCase

StateBag オブジェクトで大文字と小文字が区別されないかどうかを示す値を取得します。

(継承元 Control)
ViewStateMode

このコントロールのビューステート モードを取得または設定します。

(継承元 Control)
Visible

サーバー コントロールがページ上の UI としてレンダリングされるかどうかを示す値を取得または設定します。

(継承元 Control)
Width

Web サーバー コントロールの幅を取得または設定します。

(継承元 WebControl)

メソッド

名前 説明
AddAttributesToRender(HtmlTextWriter)

指定した HtmlTextWriterTagにレンダリングする必要がある HTML 属性とスタイルを追加します。 このメソッドは、主にコントロール開発者によって使用されます。

(継承元 WebControl)
AddedControl(Control, Int32)

子コントロールがControls オブジェクトのControl コレクションに追加された後に呼び出されます。

(継承元 Control)
AddParsedSubObject(Object)

XML または HTML のいずれかの要素が解析されたことをサーバー コントロールに通知し、その要素をサーバー コントロールの ControlCollection オブジェクトに追加します。

(継承元 Control)
ApplyStyle(Style)

指定したスタイルの空白以外の要素を Web コントロールにコピーし、コントロールの既存のスタイル要素を上書きします。 このメソッドは、主にコントロール開発者によって使用されます。

(継承元 WebControl)
ApplyStyleSheetSkin(Page)

ページ スタイル シートで定義されているスタイル プロパティをコントロールに適用します。

(継承元 Control)
BeginRenderTracing(TextWriter, Object)

レンダリング データのデザイン時トレースを開始します。

(継承元 Control)
BuildProfileTree(String, Boolean)

サーバー コントロールに関する情報を収集し、ページのトレースが有効になっているときに表示される Trace プロパティに渡します。

(継承元 Control)
ClearCachedClientID()

キャッシュされた ClientID 値を nullに設定します。

(継承元 Control)
ClearChildControlState()

サーバー コントロールの子コントロールのコントロール状態情報を削除します。

(継承元 Control)
ClearChildState()

すべてのサーバー コントロールの子コントロールのビューステート情報とコントロール状態情報を削除します。

(継承元 Control)
ClearChildViewState()

すべてのサーバー コントロールの子コントロールのビューステート情報を削除します。

(継承元 Control)
ClearEffectiveClientIDMode()

現在のコントロール インスタンスと子コントロールの ClientIDMode プロパティを Inheritに設定します。

(継承元 Control)
ConfirmInitState()

データ バインド コントロールの初期化された状態を設定します。

(継承元 BaseDataBoundControl)
CopyBaseAttributes(WebControl)

Style オブジェクトによってカプセル化されていないプロパティを、指定した Web サーバー コントロールから、このメソッドが呼び出される Web サーバー コントロールにコピーします。 このメソッドは、主にコントロール開発者によって使用されます。

(継承元 WebControl)
CreateChildControls()

ASP.NET ページ フレームワークによって呼び出され、コンポジション ベースの実装を使用して、ポスト バックまたはレンダリングの準備として含まれる子コントロールを作成するサーバー コントロールに通知します。

(継承元 Control)
CreateControlCollection()

サーバー コントロールの子コントロール (リテラルとサーバーの両方) を保持する新しい ControlCollection オブジェクトを作成します。

(継承元 Control)
CreateControlStyle()

すべてのスタイル関連プロパティを実装するために、 WebControl クラスによって内部的に使用されるスタイル オブジェクトを作成します。 このメソッドは、主にコントロール開発者によって使用されます。

(継承元 WebControl)
CreateDataSourceSelectArguments()

引数が指定されていない場合に、データ バインド コントロールによって使用される既定の DataSourceSelectArguments オブジェクトを作成します。

DataBind()

呼び出されたサーバー コントロールとそのすべての子コントロールにデータ ソースをバインドします。

(継承元 BaseDataBoundControl)
DataBind(Boolean)

DataBinding イベントを発生させるオプションを使用して、呼び出されたサーバー コントロールとそのすべての子コントロールにデータ ソースをバインドします。

(継承元 Control)
DataBindChildren()

データ ソースをサーバー コントロールの子コントロールにバインドします。

(継承元 Control)
Dispose()

サーバー コントロールがメモリから解放される前に、最終的なクリーンアップを実行できるようにします。

(継承元 Control)
EndRenderTracing(TextWriter, Object)

レンダリング データのデザイン時トレースを終了します。

(継承元 Control)
EnsureChildControls()

サーバー コントロールに子コントロールが含まれているかどうかを判断します。 そうでない場合は、子コントロールが作成されます。

(継承元 Control)
EnsureDataBound()

DataBind() プロパティが設定され、データ バインド コントロールにバインドが必要とマークされている場合は、DataSourceID メソッドを呼び出します。

(継承元 BaseDataBoundControl)
EnsureID()

識別子が割り当てられないコントロールの識別子を作成します。

(継承元 Control)
Equals(Object)

指定したオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
FindControl(String, Int32)

id パラメーターで指定された、指定したpathOffsetと整数を持つサーバー コントロールの現在の名前付けコンテナーを検索します。これは、検索に役立ちます。 このバージョンの FindControl メソッドはオーバーライドしないでください。

(継承元 Control)
FindControl(String)

指定した id パラメーターを使用して、サーバー コントロールの現在の名前付けコンテナーを検索します。

(継承元 Control)
Focus()

入力フォーカスをコントロールに設定します。

(継承元 Control)
GetData()

データ バインド コントロールがデータ操作の実行に使用する DataSourceView オブジェクトを取得します。

GetDataSource()

データ バインド コントロールが関連付けられている IDataSource インターフェイス (存在する場合) を取得します。

GetDesignModeState()

コントロールのデザイン時データを取得します。

(継承元 Control)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetRouteUrl(Object)

ルート パラメーターのセットに対応する URL を取得します。

(継承元 Control)
GetRouteUrl(RouteValueDictionary)

ルート パラメーターのセットに対応する URL を取得します。

(継承元 Control)
GetRouteUrl(String, Object)

ルート パラメーターとルート名のセットに対応する URL を取得します。

(継承元 Control)
GetRouteUrl(String, RouteValueDictionary)

ルート パラメーターとルート名のセットに対応する URL を取得します。

(継承元 Control)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
GetUniqueIDRelativeTo(Control)

指定したコントロールの UniqueID プロパティのプレフィックス部分を返します。

(継承元 Control)
HasControls()

サーバー コントロールに子コントロールが含まれているかどうかを判断します。

(継承元 Control)
HasEvents()

コントロールまたは子コントロールのイベントが登録されているかどうかを示す値を返します。

(継承元 Control)
IsLiteralContent()

サーバー コントロールがリテラル コンテンツのみを保持するかどうかを決定します。

(継承元 Control)
LoadControlState(Object)

SaveControlState() メソッドによって保存された前のページ要求から制御状態情報を復元します。

(継承元 Control)
LoadViewState(Object)

SaveViewState() メソッドによって保存された前のページ要求からビューステート情報を復元します。

LoadViewState(Object)

SaveViewState() メソッドで保存された以前の要求からビューステート情報を復元します。

(継承元 WebControl)
MapPathSecure(String)

仮想パス (絶対パスまたは相対パス) がマップされる物理パスを取得します。

(継承元 Control)
MarkAsDataBound()

ビューステート内のコントロールの状態を、データに正常にバインドされるように設定します。

MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
MergeStyle(Style)

指定したスタイルの空白以外の要素を Web コントロールにコピーしますが、コントロールの既存のスタイル要素は上書きしません。 このメソッドは、主にコントロール開発者によって使用されます。

(継承元 WebControl)
OnBubbleEvent(Object, EventArgs)

サーバー コントロールのイベントがページの UI サーバー コントロール階層に渡されるかどうかを判断します。

(継承元 Control)
OnCreatingModelDataSource(CreatingModelDataSourceEventArgs)

CreatingModelDataSource イベントを発生させます。

OnDataBinding(EventArgs)

DataBinding イベントを発生させます。

(継承元 Control)
OnDataBound(EventArgs)

DataBound イベントを発生させます。

(継承元 BaseDataBoundControl)
OnDataPropertyChanged()

基本データ ソース識別プロパティの 1 つが変更された後、データ バインド コントロールをデータに再バインドします。

OnDataSourceViewChanged(Object, EventArgs)

DataSourceViewChanged イベントを発生させます。

OnInit(EventArgs)

Init イベントを処理します。

(継承元 BaseDataBoundControl)
OnLoad(EventArgs)

Load イベントを処理します。

OnPagePreLoad(Object, EventArgs)

コントロールが読み込まれる前に、データ バインド コントロールの初期化された状態を設定します。

OnPreRender(EventArgs)

PreRender イベントを処理します。

(継承元 BaseDataBoundControl)
OnUnload(EventArgs)

Unload イベントを発生させます。

(継承元 Control)
OpenFile(String)

ファイルの読み取りに使用する Stream を取得します。

(継承元 Control)
PerformDataBinding(IEnumerable)

派生クラスでオーバーライドされると、データ ソースのデータをコントロールにバインドします。

PerformSelect()

関連付けられているデータ ソースからデータを取得します。

RaiseBubbleEvent(Object, EventArgs)

イベントのソースとその情報をコントロールの親に割り当てます。

(継承元 Control)
RemovedControl(Control)

Controls オブジェクトのControl コレクションから子コントロールが削除された後に呼び出されます。

(継承元 Control)
Render(HtmlTextWriter)

指定した HTML ライターにコントロールをレンダリングします。

(継承元 WebControl)
RenderBeginTag(HtmlTextWriter)

コントロールの HTML 開始タグを指定されたライターにレンダリングします。 このメソッドは、主にコントロール開発者によって使用されます。

(継承元 WebControl)
RenderChildren(HtmlTextWriter)

指定した HtmlTextWriter オブジェクトにサーバー コントロールの子のコンテンツを出力します。このオブジェクトは、クライアントにレンダリングされるコンテンツを書き込みます。

(継承元 Control)
RenderContents(HtmlTextWriter)

コントロールの内容を指定したライターにレンダリングします。 このメソッドは、主にコントロール開発者によって使用されます。

(継承元 WebControl)
RenderControl(HtmlTextWriter, ControlAdapter)

指定されたHtmlTextWriter オブジェクトを使用して、指定されたControlAdapter オブジェクトにサーバー コントロールのコンテンツを出力します。

(継承元 Control)
RenderControl(HtmlTextWriter)

指定された HtmlTextWriter オブジェクトにサーバー コントロールの内容を出力し、トレースが有効になっている場合は、コントロールに関するトレース情報を格納します。

(継承元 Control)
RenderEndTag(HtmlTextWriter)

コントロールの HTML 終了タグを指定されたライターにレンダリングします。 このメソッドは、主にコントロール開発者によって使用されます。

(継承元 WebControl)
ResolveAdapter()

指定したコントロールのレンダリングを担当するコントロール アダプターを取得します。

(継承元 Control)
ResolveClientUrl(String)

ブラウザーで使用できる URL を取得します。

(継承元 Control)
ResolveUrl(String)

URL を、要求側クライアントで使用できる URL に変換します。

(継承元 Control)
SaveControlState()

ページがサーバーにポストバックされた時刻以降に発生したすべてのサーバー 制御状態の変更を保存します。

(継承元 Control)
SaveViewState()

ページがサーバーにポストバックされた時刻以降に発生したビューステートの変更を保存します。

SaveViewState()

TrackViewState() メソッドが呼び出された後に変更されたすべての状態を保存します。

(継承元 WebControl)
SetDesignModeState(IDictionary)

コントロールのデザイン時データを設定します。

(継承元 Control)
SetRenderMethodDelegate(RenderMethod)

サーバー コントロールとそのコンテンツを親コントロールにレンダリングするイベント ハンドラー デリゲートを割り当てます。

(継承元 Control)
SetTraceData(Object, Object, Object)

トレース オブジェクト、トレース データ キー、およびトレース データ値を使用して、レンダリング データのデザイン時トレース用のトレース データを設定します。

(継承元 Control)
SetTraceData(Object, Object)

トレース データ キーとトレース データ値を使用して、レンダリング データのデザイン時トレース用のトレース データを設定します。

(継承元 Control)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)
TrackViewState()

コントロールのビューステートの変更を追跡して、コントロールの StateBag オブジェクトに格納できるようにします。

TrackViewState()

コントロールがビューステートの変更を追跡し、オブジェクトの ViewState プロパティに格納できるようにします。

(継承元 WebControl)
ValidateDataSource(Object)

データ バインド コントロールがバインドするオブジェクトが、操作できるオブジェクトであることを確認します。

イベント

名前 説明
CallingDataMethods

データ メソッドが呼び出されるときに発生します。

CreatingModelDataSource

ModelDataSource オブジェクトが作成されるときに発生します。

DataBinding

サーバー コントロールがデータ ソースにバインドされるときに発生します。

(継承元 Control)
DataBound

サーバー コントロールがデータ ソースにバインドされた後に発生します。

(継承元 BaseDataBoundControl)
Disposed

サーバー コントロールがメモリから解放されたときに発生します。これは、ASP.NET ページが要求されたときに、サーバー コントロールライフサイクルの最後のステージです。

(継承元 Control)
Init

サーバー コントロールが初期化されるときに発生します。これは、そのライフサイクルの最初のステップです。

(継承元 Control)
Load

サーバー コントロールが Page オブジェクトに読み込まれるときに発生します。

(継承元 Control)
PreRender

Control オブジェクトが読み込まれた後、レンダリングの前に発生します。

(継承元 Control)
Unload

サーバー コントロールがメモリからアンロードされるときに発生します。

(継承元 Control)

明示的なインターフェイスの実装

名前 説明
IAttributeAccessor.GetAttribute(String)

指定した名前の Web コントロールの属性を取得します。

(継承元 WebControl)
IAttributeAccessor.SetAttribute(String, String)

Web コントロールの属性を指定した名前と値に設定します。

(継承元 WebControl)
IControlBuilderAccessor.ControlBuilder

このメンバーの説明については、 ControlBuilderを参照してください。

(継承元 Control)
IControlDesignerAccessor.GetDesignModeState()

このメンバーの説明については、 GetDesignModeState()を参照してください。

(継承元 Control)
IControlDesignerAccessor.SetDesignModeState(IDictionary)

このメンバーの説明については、 SetDesignModeState(IDictionary)を参照してください。

(継承元 Control)
IControlDesignerAccessor.SetOwnerControl(Control)

このメンバーの説明については、 SetOwnerControl(Control)を参照してください。

(継承元 Control)
IControlDesignerAccessor.UserData

このメンバーの説明については、 UserDataを参照してください。

(継承元 Control)
IDataBindingsAccessor.DataBindings

このメンバーの説明については、 DataBindingsを参照してください。

(継承元 Control)
IDataBindingsAccessor.HasDataBindings

このメンバーの説明については、 HasDataBindingsを参照してください。

(継承元 Control)
IExpressionsAccessor.Expressions

このメンバーの説明については、 Expressionsを参照してください。

(継承元 Control)
IExpressionsAccessor.HasExpressions

このメンバーの説明については、 HasExpressionsを参照してください。

(継承元 Control)
IParserAccessor.AddParsedSubObject(Object)

このメンバーの説明については、 AddParsedSubObject(Object)を参照してください。

(継承元 Control)

拡張メソッド

名前 説明
EnablePersistedSelection(BaseDataBoundControl)
古い.

選択とページングをサポートするデータ コントロールで選択を保持できるようにします。

FindDataSourceControl(Control)

指定したコントロールのデータ コントロールに関連付けられているデータ ソースを返します。

FindFieldTemplate(Control, String)

指定したコントロールの名前付けコンテナー内の指定した列のフィールド テンプレートを返します。

FindMetaTable(Control)

格納されているデータ コントロールのメタテーブル オブジェクトを返します。

適用対象

こちらもご覧ください