DataBoundControlAdapter.Control 属性

定义

检索对与此控件适配器关联的 DataBoundControl 对象的强类型引用。

protected:
 property System::Web::UI::WebControls::DataBoundControl ^ Control { System::Web::UI::WebControls::DataBoundControl ^ get(); };
protected System.Web.UI.WebControls.DataBoundControl Control { get; }
member this.Control : System.Web.UI.WebControls.DataBoundControl
Protected ReadOnly Property Control As DataBoundControl

属性值

DataBoundControl

附加此 DataBoundControlDataBoundControlAdapter

示例

下面的代码示例演示如何重写 ControlDataBoundControlAdapter 类派生的适配器中的属性。 它返回对 MyDataBound 控件的强类型引用。

// Returns a strongly-typed reference to the MyDataBound control.
public new MyDataBound Control
{
    get
    {
        return (MyDataBound)base.Control;
    }
}
' Returns a strongly-typed reference to the MyDataBound control.
Public Shadows ReadOnly Property Control() As MyDataBound
    Get
        Return CType(MyBase.Control, MyDataBound)
    End Get
End Property

注解

DataBoundControlAdapter当对象附加到DataBoundControl控件时,.NET Framework调用某些适配器成员而不是控件成员。

继承者说明

DataBoundControlAdapter 类继承时,应至少实现一个 Control 属性以返回控件的强类型实例,如“示例”部分所示

适用于

另请参阅