語言

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 DataBoundControlAdapter這本書就是附著的。

範例

以下程式碼範例展示了如何在由類別Control衍生的適配器中覆寫該DataBoundControlAdapter屬性。 它會回傳一個強打型的控制項參考 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 屬性來回傳一個強型別的控制項實例,如範例章節所示

適用於

另請參閱