DataBoundControl クラス
定義
データをリストまたは表形式で表示する ASP.NET Version 2.0 のデータ バインド コントロールすべての基底クラスとして機能します。Serves as the base class for all ASP.NET version 2.0 data-bound controls that display their data in list or tabular form.
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 カスタムデータバインドコントロールを作成する方法を示しています。The following code example demonstrates how to derive a class from the DataBoundControl class to create a custom data-bound control. コントロールは、 TextBoxSet
TextBox 関連付けられたデータソースコントロールから取得される各データ項目のコントロールを作成し、実行時にデータ項目の値にバインドします。The TextBoxSet
control creates a TextBox control for each data item retrieved from its associated data source control, and binds to the value of the data item at run time. メソッドの現在の実装では、 Render
TextBox コントロールが順序付けられていないリストとしてレンダリングされます。The current implementation of the Render
method renders the TextBox controls as an unordered list.
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 います。The following code example demonstrates how to use the TextBoxSet
control, defined in the previous example, and bind it to an AccessDataSource control.
<%@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 コントロールに使用される基本クラスです。The DataBoundControl class is the base class used for ASP.NET controls that retrieve tabular or list-style data from an ASP.NET data source control and bind user-interface (UI) elements of the control to that data for display. 、、などの複合データバインドコントロール GridView 、および DetailsView FormView などのリスト形式のデータバインドコントロールと、 BulletedList CheckBoxList AdRotator から派生するなどの他のコントロール DataBoundControl 。Composite data-bound controls such as GridView, DetailsView, and FormView; list-style data-bound controls such as BulletedList and CheckBoxList; and other controls such as AdRotator derive from DataBoundControl.
ページ開発者はクラスを直接使用しません DataBoundControl 。代わりに、このクラスから派生したコントロールを使用します。Page developers do not use the DataBoundControl class directly; instead, they use controls that derive from this class.
コントロール開発者は、このクラスを拡張して、 IDataSource およびクラスから派生したインターフェイスとクラスを実装するクラスを使用するデータバインドコントロールを作成し DataSourceControl DataSourceView ます。Control developers extend this class to create data-bound controls that work with classes that implement the IDataSource interface and classes that derive from the DataSourceControl and DataSourceView classes. クラスからクラスを派生さ DataBoundControl せる場合は、メソッドをオーバーライドし PerformDataBinding て、コントロールの UI 要素をメソッドによって取得されたデータにバインドし GetData ます。When deriving a class from the DataBoundControl class, override the PerformDataBinding method to bind the UI elements of your control to data retrieved by the GetData method. ほとんどの場合、 PerformDataBinding メソッドは、派生クラスでオーバーライドする唯一のメソッドです。In most cases, the PerformDataBinding method is the only method you will override in your derived class.
ASP.NET 2.0 データバインドコントロールの場合、 PerformSelect メソッドはメソッドに相当し DataBind
ます。これは、実行時にデータをバインドするために呼び出されます。For ASP.NET 2.0 data-bound controls, the PerformSelect method is the equivalent of the DataBind
method, and is called to bind data at run time. メソッドは、メソッド PerformSelect GetData およびメソッドを呼び出し PerformDataBinding ます。The PerformSelect method calls the GetData and PerformDataBinding methods.
コンストラクター
DataBoundControl() |
継承クラス インスタンスによって使用される DataBoundControl クラスを初期化します。Initializes the DataBoundControl class for use by an inherited class instance. このコンストラクターは、継承クラスによってのみ呼び出すことができます。This constructor can only be called by an inherited class. |
プロパティ
AccessKey |
Web サーバー コントロールにすばやく移動できるアクセス キーを取得または設定します。Gets or sets the access key that allows you to quickly navigate to the Web server control. (継承元 WebControl) |
Adapter |
コントロール用のブラウザー固有のアダプターを取得します。Gets the browser-specific adapter for the control. (継承元 Control) |
AppRelativeTemplateSourceDirectory |
このコントロールが含まれている Page オブジェクトまたは UserControl オブジェクトのアプリケーション相対の仮想ディレクトリを取得または設定します。Gets or sets the application-relative virtual directory of the Page or UserControl object that contains this control. (継承元 Control) |
Attributes |
コントロールのプロパティに対応しない任意の属性 (表示専用) のコレクションを取得します。Gets the collection of arbitrary attributes (for rendering only) that do not correspond to properties on the control. (継承元 WebControl) |
BackColor |
Web サーバー コントロールの背景色を取得または設定します。Gets or sets the background color of the Web server control. (継承元 WebControl) |
BindingContainer |
このコントロールのデータ バインディングを格納しているコントロールを取得します。Gets the control that contains this control's data binding. (継承元 Control) |
BorderColor |
Web コントロールの境界線の色を取得または設定します。Gets or sets the border color of the Web control. (継承元 WebControl) |
BorderStyle |
Web サーバー コントロールの境界線スタイルを取得または設定します。Gets or sets the border style of the Web server control. (継承元 WebControl) |
BorderWidth |
Web サーバー コントロールの境界線の幅を取得または設定します。Gets or sets the border width of the Web server control. (継承元 WebControl) |
ChildControlsCreated |
サーバー コントロールの子コントロールが作成されたかどうかを示す値を取得します。Gets a value that indicates whether the server control's child controls have been created. (継承元 Control) |
ClientID |
ASP.NET によって生成される HTML マークアップのコントロール ID を取得します。Gets the control ID for HTML markup that is generated by ASP.NET. (継承元 Control) |
ClientIDMode |
ClientID プロパティの値を生成するために使用されるアルゴリズムを取得または設定します。Gets or sets the algorithm that is used to generate the value of the ClientID property. (継承元 Control) |
ClientIDSeparator |
ClientID プロパティで使用される区切り記号を表す文字値を取得します。Gets a character value representing the separator character used in the ClientID property. (継承元 Control) |
Context |
現在の Web 要求に対するサーバー コントロールに関連付けられている HttpContext オブジェクトを取得します。Gets the HttpContext object associated with the server control for the current Web request. (継承元 Control) |
Controls |
UI 階層内の指定されたサーバー コントロールの子コントロールを表す ControlCollection オブジェクトを取得します。Gets a ControlCollection object that represents the child controls for a specified server control in the UI hierarchy. (継承元 Control) |
ControlStyle |
Web サーバー コントロールのスタイルを取得します。Gets the style of the Web server control. このプロパティは、主にコントロールの開発者によって使用されます。This property is used primarily by control developers. (継承元 WebControl) |
ControlStyleCreated |
Style オブジェクトが ControlStyle プロパティに対して作成されたかどうかを示す値を取得します。Gets a value indicating whether a Style object has been created for the ControlStyle property. このプロパティは、主にコントロールの開発者によって使用されます。This property is primarily used by control developers. (継承元 WebControl) |
CssClass |
クライアントで Web サーバー コントロールによって表示されるカスケード スタイル シート (CSS: Cascading Style Sheet) クラスを取得または設定します。Gets or sets the Cascading Style Sheet (CSS) class rendered by the Web server control on the client. (継承元 WebControl) |
DataItemContainer |
名前付けコンテナーが IDataItemContainer を実装している場合、名前付けコンテナーへの参照を取得します。Gets a reference to the naming container if the naming container implements IDataItemContainer. (継承元 Control) |
DataKeysContainer |
名前付けコンテナーが IDataKeysControl を実装している場合、名前付けコンテナーへの参照を取得します。Gets a reference to the naming container if the naming container implements IDataKeysControl. (継承元 Control) |
DataMember |
データ ソースに複数の個別のデータ項目一覧が含まれている場合に、データ バインド コントロールがバインドされるデータの一覧の名前を取得または設定します。Gets or sets the name of the list of data that the data-bound control binds to, in cases where the data source contains more than one distinct list of data items. |
DataSource |
データ バインド コントロールがデータ項目一覧を取得する際の取得元となるオブジェクトを取得または設定します。Gets or sets the object from which the data-bound control retrieves its list of data items. (継承元 BaseDataBoundControl) |
DataSourceID |
データ バインド コントロールによるデータ項目の一覧の取得元となるコントロールの ID を取得または設定します。Gets or sets the ID of the control from which the data-bound control retrieves its list of data items. |
DataSourceObject |
オブジェクトのデータ コンテンツにアクセスできる IDataSource インターフェイスを実装するオブジェクトを取得します。Gets an object that implements the IDataSource interface, which provides access to the object's data content. |
DesignMode |
コントロールがデザイン サーフェイスで使用されているかどうかを示す値を取得します。Gets a value indicating whether a control is being used on a design surface. (継承元 Control) |
Enabled |
Web サーバー コントロールを有効にするかどうかを示す値を取得または設定します。Gets or sets a value indicating whether the Web server control is enabled. (継承元 WebControl) |
EnableTheming |
テーマがこのコントロールに適用されるかどうかを示す値を取得または設定します。Gets or sets a value indicating whether themes apply to this control. (継承元 WebControl) |
EnableViewState |
要求元クライアントに対して、サーバー コントロールがそのビュー状態と、そこに含まれる任意の子のコントロールのビュー状態を保持するかどうかを示す値を取得または設定します。Gets or sets a value indicating whether the server control persists its view state, and the view state of any child controls it contains, to the requesting client. (継承元 Control) |
Events |
コントロールのイベント ハンドラー デリゲートのリストを取得します。Gets a list of event handler delegates for the control. このプロパティは読み取り専用です。This property is read-only. (継承元 Control) |
Font |
Web サーバー コントロールに関連付けられたフォント プロパティを取得します。Gets the font properties associated with the Web server control. (継承元 WebControl) |
ForeColor |
Web サーバー コントロールの前景色 (通常はテキストの色) を取得または設定します。Gets or sets the foreground color (typically the color of the text) of the Web server control. (継承元 WebControl) |
HasAttributes |
コントロールに属性セットがあるかどうかを示す値を取得します。Gets a value indicating whether the control has attributes set. (継承元 WebControl) |
HasChildViewState |
現在のサーバー コントロールの子コントロールが、保存されたビューステートの設定を持っているかどうかを示す値を取得します。Gets a value indicating whether the current server control's child controls have any saved view-state settings. (継承元 Control) |
Height |
Web サーバー コントロールの高さを取得または設定します。Gets or sets the height of the Web server control. (継承元 WebControl) |
ID |
サーバー コントロールに割り当てられたプログラム ID を取得または設定します。Gets or sets the programmatic identifier assigned to the server control. (継承元 Control) |
IdSeparator |
コントロール ID を区別するために使用する文字を取得します。Gets the character used to separate control identifiers. (継承元 Control) |
Initialized |
データ バインド コントロールが初期化されているかどうかを示す値を取得します。Gets a value indicating whether the data-bound control has been initialized. (継承元 BaseDataBoundControl) |
IsBoundUsingDataSourceID |
DataSourceID プロパティが設定されているかどうかを示す値を取得します。Gets a value indicating whether the DataSourceID property is set. (継承元 BaseDataBoundControl) |
IsChildControlStateCleared |
このコントロールに含まれているコントロールに、コントロールの状態が設定されているかどうかを示す値を取得します。Gets a value indicating whether controls contained within this control have control state. (継承元 Control) |
IsDataBindingAutomatic |
データ バインドが自動かどうか示す値を取得します。Gets a value that indicates whether data binding is automatic. (継承元 BaseDataBoundControl) |
IsEnabled |
コントロールが有効かどうかを示す値を取得します。Gets a value indicating whether the control is enabled. (継承元 WebControl) |
IsTrackingViewState |
サーバー コントロールがビューステートの変更を保存しているかどうかを示す値を取得します。Gets a value that indicates whether the server control is saving changes to its view state. (継承元 Control) |
IsUsingModelBinders |
モデル バインディングが使用中かどうかを示す値を取得します。Gets a value that indicates whether model binding is in use. |
IsUsingModelBinders |
派生クラスで実装された場合、コントロールでモデル バインダーを使用しているかどうかを示す値を取得します。When implemented in a derived class, gets a value that indicates whether the control is using model binders. (継承元 BaseDataBoundControl) |
IsViewStateEnabled |
このコントロールでビューステートが有効かどうかを示す値を取得します。Gets a value indicating whether view state is enabled for this control. (継承元 Control) |
ItemType |
厳密に型指定されているデータ バインディングのデータ項目型の名前を取得または設定します。Gets or sets the name of the data item type for strongly typed data binding. |
LoadViewStateByID |
コントロールがインデックスではなく ID によりビューステートの読み込みを行うかどうかを示す値を取得します。Gets a value indicating whether the control participates in loading its view state by ID instead of index. (継承元 Control) |
NamingContainer |
同じ ID プロパティ値を持つ複数のサーバー コントロールを区別するための一意の名前空間を作成する、サーバー コントロールの名前付けコンテナーへの参照を取得します。Gets a reference to the server control's naming container, which creates a unique namespace for differentiating between server controls with the same ID property value. (継承元 Control) |
Page |
サーバー コントロールを含んでいる Page インスタンスへの参照を取得します。Gets a reference to the Page instance that contains the server control. (継承元 Control) |
Parent |
ページ コントロールの階層構造における、サーバー コントロールの親コントロールへの参照を取得します。Gets a reference to the server control's parent control in the page control hierarchy. (継承元 Control) |
RenderingCompatibility |
レンダリングされる HTML と互換性がある ASP.NET のバージョンを表す値を取得します。Gets a value that specifies the ASP.NET version that rendered HTML will be compatible with. (継承元 Control) |
RequiresDataBinding |
DataBind() メソッドを呼び出す必要があるかどうか示す値を取得または設定します。Gets or sets a value indicating whether the DataBind() method should be called. (継承元 BaseDataBoundControl) |
SelectArguments |
データ バインド コントロールが、データ ソース コントロールからデータを取得するときに使用する DataSourceSelectArguments オブジェクトを取得します。Gets a DataSourceSelectArguments object that the data-bound control uses when retrieving data from a data source control. |
SelectMethod |
データを読み取るために呼び出すメソッドの名前。The name of the method to call in order to read data. |
Site |
デザイン サーフェイスに現在のコントロールを表示するときに、このコントロールをホストするコンテナーに関する情報を取得します。Gets information about the container that hosts the current control when rendered on a design surface. (継承元 Control) |
SkinID |
コントロールに適用するスキンを取得または設定します。Gets or sets the skin to apply to the control. (継承元 WebControl) |
Style |
Web サーバー コントロールの外側のタグにスタイル属性として表示されるテキスト属性のコレクションを取得します。Gets a collection of text attributes that will be rendered as a style attribute on the outer tag of the Web server control. (継承元 WebControl) |
SupportsDisabledAttribute |
コントロールの |
TabIndex |
Web サーバー コントロールのタブ インデックスを取得または設定します。Gets or sets the tab index of the Web server control. (継承元 WebControl) |
TagKey |
この Web サーバー コントロールに対応する HtmlTextWriterTag 値を取得します。Gets the HtmlTextWriterTag value that corresponds to this Web server control. このプロパティは、主にコントロールの開発者によって使用されます。This property is used primarily by control developers. (継承元 WebControl) |
TagName |
コントロール タグの名前を取得します。Gets the name of the control tag. このプロパティは、主にコントロールの開発者によって使用されます。This property is used primarily by control developers. (継承元 WebControl) |
TemplateControl |
このコントロールを格納しているテンプレートへの参照を取得または設定します。Gets or sets a reference to the template that contains this control. (継承元 Control) |
TemplateSourceDirectory |
現在のサーバー コントロールを格納している Page または UserControl の仮想ディレクトリを取得します。Gets the virtual directory of the Page or UserControl that contains the current server control. (継承元 Control) |
ToolTip |
マウス ポインターが Web サーバー コントロールの上を移動したときに表示されるテキストを取得または設定します。Gets or sets the text displayed when the mouse pointer hovers over the Web server control. (継承元 WebControl) |
UniqueID |
階層構造で修飾されたサーバー コントロールの一意の ID を取得します。Gets the unique, hierarchically qualified identifier for the server control. (継承元 Control) |
ValidateRequestMode |
ブラウザーからのクライアント入力の安全性をコントロールで調べるかどうかを示す値を取得または設定します。Gets or sets a value that indicates whether the control checks client input from the browser for potentially dangerous values. (継承元 Control) |
ViewState |
同一のページに対する複数の要求にわたって、サーバー コントロールのビューステートを保存し、復元できるようにする状態情報のディクショナリを取得します。Gets a dictionary of state information that allows you to save and restore the view state of a server control across multiple requests for the same page. (継承元 Control) |
ViewStateIgnoresCase |
StateBag オブジェクトが大文字小文字を区別しないかどうかを示す値を取得します。Gets a value that indicates whether the StateBag object is case-insensitive. (継承元 Control) |
ViewStateMode |
このコントロールのビューステート モードを取得または設定します。Gets or sets the view-state mode of this control. (継承元 Control) |
Visible |
サーバー コントロールがページ上の UI としてレンダリングされているかどうかを示す値を取得または設定します。Gets or sets a value that indicates whether a server control is rendered as UI on the page. (継承元 Control) |
Width |
Web サーバー コントロールの幅を取得または設定します。Gets or sets the width of the Web server control. (継承元 WebControl) |
メソッド
AddAttributesToRender(HtmlTextWriter) |
指定した HtmlTextWriterTag に表示する必要のある HTML 属性およびスタイルを追加します。Adds HTML attributes and styles that need to be rendered to the specified HtmlTextWriterTag. このメソッドは、主にコントロールの開発者によって使用されます。This method is used primarily by control developers. (継承元 WebControl) |
AddedControl(Control, Int32) |
子コントロールが Control オブジェクトの Controls コレクションに追加された後に呼び出されます。Called after a child control is added to the Controls collection of the Control object. (継承元 Control) |
AddParsedSubObject(Object) |
XML または HTML のいずれかの要素が解析されたことをサーバー コントロールに通知し、サーバー コントロールの ControlCollection オブジェクトに要素を追加します。Notifies the server control that an element, either XML or HTML, was parsed, and adds the element to the server control's ControlCollection object. (継承元 Control) |
ApplyStyle(Style) |
指定したスタイルの空白以外の要素を Web コントロールにコピーして、コントロールの既存のスタイル要素を上書きします。Copies any nonblank elements of the specified style to the Web control, overwriting any existing style elements of the control. このメソッドは、主にコントロールの開発者によって使用されます。This method is primarily used by control developers. (継承元 WebControl) |
ApplyStyleSheetSkin(Page) |
ページのスタイル シートに定義されたスタイル プロパティをコントロールに適用します。Applies the style properties defined in the page style sheet to the control. (継承元 Control) |
BeginRenderTracing(TextWriter, Object) |
レンダリング データのデザイン時のトレースを開始します。Begins design-time tracing of rendering data. (継承元 Control) |
BuildProfileTree(String, Boolean) |
ページのトレースが有効な場合、サーバー コントロールに関する情報を収集し、これを表示するために Trace プロパティに渡します。Gathers information about the server control and delivers it to the Trace property to be displayed when tracing is enabled for the page. (継承元 Control) |
ClearCachedClientID() |
キャッシュされた ClientID 値を |
ClearChildControlState() |
サーバー コントロールのすべての子コントロールについて、コントロールの状態情報を削除します。Deletes the control-state information for the server control's child controls. (継承元 Control) |
ClearChildState() |
サーバー コントロールのすべての子コントロールのビューステート情報およびコントロールの状態情報を削除します。Deletes the view-state and control-state information for all the server control's child controls. (継承元 Control) |
ClearChildViewState() |
サーバー コントロールのすべての子コントロールのビューステート情報を削除します。Deletes the view-state information for all the server control's child controls. (継承元 Control) |
ClearEffectiveClientIDMode() |
現在のコントロール インスタンスおよびすべての子コントロールの ClientIDMode プロパティを Inherit に設定します。Sets the ClientIDMode property of the current control instance and of any child controls to Inherit. (継承元 Control) |
ConfirmInitState() |
データ バインド コントロールの初期化状態を設定します。Sets the initialized state of the data-bound control. (継承元 BaseDataBoundControl) |
CopyBaseAttributes(WebControl) |
指定した Web サーバー コントロールから、Style オブジェクトでカプセル化されていないプロパティをこのメソッドの呼び出し元の Web サーバー コントロールにコピーします。Copies the properties not encapsulated by the Style object from the specified Web server control to the Web server control that this method is called from. このメソッドは、主にコントロールの開発者によって使用されます。This method is used primarily by control developers. (継承元 WebControl) |
CreateChildControls() |
ASP.NET ページ フレームワークによって呼び出され、ポストバックまたはレンダリングの準備として、合成ベースの実装を使うサーバー コントロールに対し、それらのコントロールに含まれる子コントロールを作成するように通知します。Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering. (継承元 Control) |
CreateControlCollection() |
サーバー コントロールの子コントロール (リテラルとサーバーの両方) を保持する新しい ControlCollection オブジェクトを作成します。Creates a new ControlCollection object to hold the child controls (both literal and server) of the server control. (継承元 Control) |
CreateControlStyle() |
WebControl クラスで、すべてのスタイル関連プロパティを実装するために内部的に使用されるスタイル オブジェクトを作成します。Creates the style object that is used internally by the WebControl class to implement all style related properties. このメソッドは、主にコントロールの開発者によって使用されます。This method is used primarily by control developers. (継承元 WebControl) |
CreateDataSourceSelectArguments() |
引数が指定されていない場合にデータ バインド コントロールが使用する、既定の DataSourceSelectArguments オブジェクトを作成します。Creates a default DataSourceSelectArguments object used by the data-bound control if no arguments are specified. |
DataBind() |
呼び出されたサーバー コントロールとそのすべての子コントロールにデータ ソースをバインドします。Binds a data source to the invoked server control and all its child controls. (継承元 BaseDataBoundControl) |
DataBind(Boolean) |
DataBinding イベントを発生させるオプションを指定して、呼び出されたサーバー コントロールとそのすべての子コントロールにデータ ソースをバインドします。Binds a data source to the invoked server control and all its child controls with an option to raise the DataBinding event. (継承元 Control) |
DataBindChildren() |
データ ソースをサーバー コントロールの子コントロールにバインドします。Binds a data source to the server control's child controls. (継承元 Control) |
Dispose() |
サーバー コントロールが、メモリから解放される前に最終的なクリーンアップを実行できるようにします。Enables a server control to perform final clean up before it is released from memory. (継承元 Control) |
EndRenderTracing(TextWriter, Object) |
レンダリング データのデザイン時のトレースを終了します。Ends design-time tracing of rendering data. (継承元 Control) |
EnsureChildControls() |
サーバー コントロールに子コントロールが含まれているかどうかを確認します。Determines whether the server control contains child controls. 含まれていない場合、子コントロールを作成します。If it does not, it creates child controls. (継承元 Control) |
EnsureDataBound() |
DataBind() プロパティが設定されていて、データ バインド コントロールにバインディングが必要とマークされている場合に、DataSourceID メソッドを呼び出します。Calls the DataBind() method if the DataSourceID property is set and the data-bound control is marked to require binding. (継承元 BaseDataBoundControl) |
EnsureID() |
ID が割り当てられていないコントロールの ID を作成します。Creates an identifier for controls that do not have an identifier assigned. (継承元 Control) |
Equals(Object) |
指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。Determines whether the specified object is equal to the current object. (継承元 Object) |
FindControl(String) |
指定した |
FindControl(String, Int32) |
指定した |
Focus() |
コントロールに入力フォーカスを設定します。Sets input focus to a control. (継承元 Control) |
GetData() |
データ操作を実行するために、データ バインド コントロールが使用する DataSourceView オブジェクトを取得します。Retrieves a DataSourceView object that the data-bound control uses to perform data operations. |
GetDataSource() |
データ バインド コントロールが関連付けられている IDataSource インターフェイスを取得します (存在する場合)。Retrieves the IDataSource interface that the data-bound control is associated with, if any. |
GetDesignModeState() |
コントロールのデザイン時データを取得します。Gets design-time data for a control. (継承元 Control) |
GetHashCode() |
既定のハッシュ関数として機能します。Serves as the default hash function. (継承元 Object) |
GetRouteUrl(Object) |
ルート パラメーターのセットに対応する URL を取得します。Gets the URL that corresponds to a set of route parameters. (継承元 Control) |
GetRouteUrl(RouteValueDictionary) |
ルート パラメーターのセットに対応する URL を取得します。Gets the URL that corresponds to a set of route parameters. (継承元 Control) |
GetRouteUrl(String, Object) |
ルート パラメーターのセットおよびルート名に対応する URL を取得します。Gets the URL that corresponds to a set of route parameters and a route name. (継承元 Control) |
GetRouteUrl(String, RouteValueDictionary) |
ルート パラメーターのセットおよびルート名に対応する URL を取得します。Gets the URL that corresponds to a set of route parameters and a route name. (継承元 Control) |
GetType() |
現在のインスタンスの Type を取得します。Gets the Type of the current instance. (継承元 Object) |
GetUniqueIDRelativeTo(Control) |
指定されたコントロールの UniqueID プロパティのプレフィックス部分を返します。Returns the prefixed portion of the UniqueID property of the specified control. (継承元 Control) |
HasControls() |
サーバー コントロールに子コントロールが含まれているかどうかを確認します。Determines if the server control contains any child controls. (継承元 Control) |
HasEvents() |
コントロールまたは子コントロールに対してイベントが登録されているかどうかを示す値を返します。Returns a value indicating whether events are registered for the control or any child controls. (継承元 Control) |
IsLiteralContent() |
サーバー コントロールがリテラルな内容だけを保持しているかどうかを決定します。Determines if the server control holds only literal content. (継承元 Control) |
LoadControlState(Object) |
SaveControlState() メソッドによって保存された前回のページ要求からコントロールの状態情報を復元します。Restores control-state information from a previous page request that was saved by the SaveControlState() method. (継承元 Control) |
LoadViewState(Object) |
SaveViewState() メソッドによって保存された前回のページ要求からビューステート情報を復元します。Restores view-state information from a previous page request that was saved by the SaveViewState() method. |
LoadViewState(Object) |
SaveViewState() メソッドで保存された前の要求からビュー ステート情報を復元します。Restores view-state information from a previous request that was saved with the SaveViewState() method. (継承元 WebControl) |
MapPathSecure(String) |
仮想パス (絶対パスまたは相対パス) の割り当て先の物理パスを取得します。Retrieves the physical path that a virtual path, either absolute or relative, maps to. (継承元 Control) |
MarkAsDataBound() |
ビューステートのコントロールの状態を、データに正常にバインドされた状態に設定します。Sets the state of the control in view state as successfully bound to data. |
MemberwiseClone() |
現在の Object の簡易コピーを作成します。Creates a shallow copy of the current Object. (継承元 Object) |
MergeStyle(Style) |
指定したスタイルの空白以外の要素を Web コントロールにコピーしますが、コントロールの既存のスタイル要素は上書きしません。Copies any nonblank elements of the specified style to the Web control, but will not overwrite any existing style elements of the control. このメソッドは、主にコントロールの開発者によって使用されます。This method is used primarily by control developers. (継承元 WebControl) |
OnBubbleEvent(Object, EventArgs) |
サーバー コントロールのイベントをページの UI サーバー コントロールの階層構造に渡すかどうかを決定します。Determines whether the event for the server control is passed up the page's UI server control hierarchy. (継承元 Control) |
OnCreatingModelDataSource(CreatingModelDataSourceEventArgs) |
CreatingModelDataSource イベントを発生させます。Raises the CreatingModelDataSource event. |
OnDataBinding(EventArgs) |
DataBinding イベントを発生させます。Raises the DataBinding event. (継承元 Control) |
OnDataBound(EventArgs) |
DataBound イベントを発生させます。Raises the DataBound event. (継承元 BaseDataBoundControl) |
OnDataPropertyChanged() |
基本データ ソースの識別プロパティの 1 つが変更された後、データ バインド コントロールをデータに再バインドします。Rebinds the data-bound control to its data after one of the base data source identification properties changes. |
OnDataSourceViewChanged(Object, EventArgs) |
DataSourceViewChanged イベントを発生させます。Raises the DataSourceViewChanged event. |
OnInit(EventArgs) |
Init イベントを処理します。Handles the Init event. (継承元 BaseDataBoundControl) |
OnLoad(EventArgs) | |
OnPagePreLoad(Object, EventArgs) |
コントロールが読み込まれる前に、データ バインド コントロールの初期化された状態を設定します。Sets the initialized state of the data-bound control before the control is loaded. |
OnPreRender(EventArgs) |
PreRender イベントを処理します。Handles the PreRender event. (継承元 BaseDataBoundControl) |
OnUnload(EventArgs) |
Unload イベントを発生させます。Raises the Unload event. (継承元 Control) |
OpenFile(String) |
ファイルの読み込みで使用される Stream を取得します。Gets a Stream used to read a file. (継承元 Control) |
PerformDataBinding(IEnumerable) |
派生クラスでオーバーライドされると、データ ソースのデータをコントロールにバインドします。When overridden in a derived class, binds data from the data source to the control. |
PerformSelect() |
関連するデータ ソースからデータを取得します。Retrieves data from the associated data source. |
RaiseBubbleEvent(Object, EventArgs) |
イベントのソースおよびその情報をコントロールの親に割り当てます。Assigns any sources of the event and its information to the control's parent. (継承元 Control) |
RemovedControl(Control) |
Control オブジェクトの Controls コレクションから子コントロールが削除された後に呼び出されます。Called after a child control is removed from the Controls collection of the Control object. (継承元 Control) |
Render(HtmlTextWriter) |
指定された HTML ライターにコントロールを描画します。Renders the control to the specified HTML writer. (継承元 WebControl) |
RenderBeginTag(HtmlTextWriter) |
コントロールの HTML 開始タグを指定したライターに表示します。Renders the HTML opening tag of the control to the specified writer. このメソッドは、主にコントロールの開発者によって使用されます。This method is used primarily by control developers. (継承元 WebControl) |
RenderChildren(HtmlTextWriter) |
提供された HtmlTextWriter オブジェクトに対してサーバー コントロールの子のコンテンツを出力すると、クライアントで表示されるコンテンツが記述されます。Outputs the content of a server control's children to a provided HtmlTextWriter object, which writes the content to be rendered on the client. (継承元 Control) |
RenderContents(HtmlTextWriter) |
コントロールの内容を指定したライターに出力します。Renders the contents of the control to the specified writer. このメソッドは、主にコントロールの開発者によって使用されます。This method is used primarily by control developers. (継承元 WebControl) |
RenderControl(HtmlTextWriter) |
指定の HtmlTextWriter オブジェクトにサーバー コントロールの内容を出力し、トレースが有効である場合はコントロールに関するトレース情報を保存します。Outputs server control content to a provided HtmlTextWriter object and stores tracing information about the control if tracing is enabled. (継承元 Control) |
RenderControl(HtmlTextWriter, ControlAdapter) |
指定した ControlAdapter オブジェクトを使用して、指定した HtmlTextWriter オブジェクトにサーバー コントロールの内容を出力します。Outputs server control content to a provided HtmlTextWriter object using a provided ControlAdapter object. (継承元 Control) |
RenderEndTag(HtmlTextWriter) |
コントロールの HTML 終了タグを指定したライターに表示します。Renders the HTML closing tag of the control into the specified writer. このメソッドは、主にコントロールの開発者によって使用されます。This method is used primarily by control developers. (継承元 WebControl) |
ResolveAdapter() |
指定したコントロールを表示するコントロール アダプターを取得します。Gets the control adapter responsible for rendering the specified control. (継承元 Control) |
ResolveClientUrl(String) |
ブラウザーで使用できる URL を取得します。Gets a URL that can be used by the browser. (継承元 Control) |
ResolveUrl(String) |
要求側クライアントで使用できる URL に変換します。Converts a URL into one that is usable on the requesting client. (継承元 Control) |
SaveControlState() |
ページがサーバーにポスト バックされた時間以降に発生したすべてのサーバー コントロール状態の変化を保存します。Saves any server control state changes that have occurred since the time the page was posted back to the server. (継承元 Control) |
SaveViewState() |
ページがサーバーにポストバックされた後で発生したビュー ステートの変更を保存します。Saves any view-state changes that have occurred since the time the page was posted back to the server. |
SaveViewState() |
TrackViewState() メソッドが呼び出された後に変更された状態を保存します。Saves any state that was modified after the TrackViewState() method was invoked. (継承元 WebControl) |
SetDesignModeState(IDictionary) |
コントロールのデザイン時データを設定します。Sets design-time data for a control. (継承元 Control) |
SetRenderMethodDelegate(RenderMethod) |
サーバー コントロールとその内容を親コントロールに表示するイベント ハンドラー デリゲートを割り当てます。Assigns an event handler delegate to render the server control and its content into its parent control. (継承元 Control) |
SetTraceData(Object, Object) |
トレース データ キーとトレース データ値を使用して、レンダリング データのデザイン時トレースのトレース データを設定します。Sets trace data for design-time tracing of rendering data, using the trace data key and the trace data value. (継承元 Control) |
SetTraceData(Object, Object, Object) |
トレースされたオブジェクト、トレース データ キー、およびトレース データ値を使用して、レンダリング データのデザイン時トレースのトレース データを設定します。Sets trace data for design-time tracing of rendering data, using the traced object, the trace data key, and the trace data value. (継承元 Control) |
ToString() |
現在のオブジェクトを表す文字列を返します。Returns a string that represents the current object. (継承元 Object) |
TrackViewState() |
コントロールの StateBag オブジェクトに変更を格納できるように、コントロールにビュー ステートの変更を追跡させます。Causes view-state changes to the control to be tracked so they can be stored in the control's StateBag object. |
TrackViewState() |
コントロールでそのビュー ステートの変化を追跡して、その変化をオブジェクトの ViewState プロパティに保存できるようにします。Causes the control to track changes to its view state so they can be stored in the object's ViewState property. (継承元 WebControl) |
ValidateDataSource(Object) |
データ バインド コントロールのバインド先のオブジェクトが処理可能かどうかを確認します。Verifies that the object a data-bound control binds to is one it can work with. |
イベント
CallingDataMethods |
データのメソッドが呼び出されるときに発生します。Occurs when data methods are being called. |
CreatingModelDataSource |
ModelDataSource オブジェクトが作成されるときに発生します。Occurs when the ModelDataSource object is being created. |
DataBinding |
サーバー コントロールがデータ ソースに連結すると発生します。Occurs when the server control binds to a data source. (継承元 Control) |
DataBound |
サーバー コントロールがデータ ソースにバインドした後に発生します。Occurs after the server control binds to a data source. (継承元 BaseDataBoundControl) |
Disposed |
サーバー コントロールがメモリから解放されると発生します。これは、ASP.NET ページが要求されている場合のサーバー コントロールの有効期間における最終段階です。Occurs when a server control is released from memory, which is the last stage of the server control lifecycle when an ASP.NET page is requested. (継承元 Control) |
Init |
サーバー コントロールが初期化されると発生します。これは、サーバー コントロールの有効期間における最初の手順です。Occurs when the server control is initialized, which is the first step in its lifecycle. (継承元 Control) |
Load |
サーバー コントロールが Page オブジェクトに読み込まれると発生します。Occurs when the server control is loaded into the Page object. (継承元 Control) |
PreRender |
Control オブジェクトの読み込み後、表示を開始する前に発生します。Occurs after the Control object is loaded but prior to rendering. (継承元 Control) |
Unload |
サーバー コントロールがメモリからアンロードされると発生します。Occurs when the server control is unloaded from memory. (継承元 Control) |
明示的なインターフェイスの実装
IAttributeAccessor.GetAttribute(String) |
指定された名前の Web コントロールの属性を取得します。Gets an attribute of the Web control with the specified name. (継承元 WebControl) |
IAttributeAccessor.SetAttribute(String, String) |
Web コントロールの属性を指定された名前と値に設定します。Sets an attribute of the Web control to the specified name and value. (継承元 WebControl) |
IControlBuilderAccessor.ControlBuilder |
このメンバーの詳細については、「ControlBuilder」をご覧ください。For a description of this member, see ControlBuilder. (継承元 Control) |
IControlDesignerAccessor.GetDesignModeState() |
このメンバーの詳細については、「GetDesignModeState()」をご覧ください。For a description of this member, see GetDesignModeState(). (継承元 Control) |
IControlDesignerAccessor.SetDesignModeState(IDictionary) |
このメンバーの詳細については、「SetDesignModeState(IDictionary)」をご覧ください。For a description of this member, see SetDesignModeState(IDictionary). (継承元 Control) |
IControlDesignerAccessor.SetOwnerControl(Control) |
このメンバーの詳細については、「SetOwnerControl(Control)」をご覧ください。For a description of this member, see SetOwnerControl(Control). (継承元 Control) |
IControlDesignerAccessor.UserData |
このメンバーの詳細については、「UserData」をご覧ください。For a description of this member, see UserData. (継承元 Control) |
IDataBindingsAccessor.DataBindings |
このメンバーの詳細については、「DataBindings」をご覧ください。For a description of this member, see DataBindings. (継承元 Control) |
IDataBindingsAccessor.HasDataBindings |
このメンバーの詳細については、「HasDataBindings」をご覧ください。For a description of this member, see HasDataBindings. (継承元 Control) |
IExpressionsAccessor.Expressions |
このメンバーの詳細については、「Expressions」をご覧ください。For a description of this member, see Expressions. (継承元 Control) |
IExpressionsAccessor.HasExpressions |
このメンバーの詳細については、「HasExpressions」をご覧ください。For a description of this member, see HasExpressions. (継承元 Control) |
IParserAccessor.AddParsedSubObject(Object) |
このメンバーの詳細については、「AddParsedSubObject(Object)」をご覧ください。For a description of this member, see AddParsedSubObject(Object). (継承元 Control) |
拡張メソッド
EnablePersistedSelection(BaseDataBoundControl) |
互換性のために残されています。
選択内容とページングをサポートするデータ コントロールで選択内容の永続化を有効にします。Enables selection to be persisted in data controls that support selection and paging. |
FindDataSourceControl(Control) |
指定されたコントロールのデータ コントロールに関連付けられているデータ ソースを返します。Returns the data source that is associated with the data control for the specified control. |
FindFieldTemplate(Control, String) |
指定されたコントロールの名前付けコンテナー内にある、指定された列のフィールド テンプレートを返します。Returns the field template for the specified column in the specified control's naming container. |
FindMetaTable(Control) |
格納しているデータ コントロールのメタテーブル オブジェクトを返します。Returns the metatable object for the containing data control. |