Share via


DataBoundControlAdapter.Control Propriété

Définition

Récupère une référence fortement typée à l'objet DataBoundControl associé à cet adaptateur de contrôle.

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

Valeur de propriété

DataBoundControl

DataBoundControl auquel DataBoundControlAdapter est attaché.

Exemples

L’exemple de code suivant montre comment remplacer la Control propriété dans un adaptateur dérivé de la DataBoundControlAdapter classe. Elle retourne une référence fortement typée au MyDataBound contrôle.

// 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

Remarques

Lorsqu’un DataBoundControlAdapter objet est attaché à un DataBoundControl contrôle, le .NET Framework appelle certains membres de l’adaptateur au lieu des membres du contrôle.

Notes pour les héritiers

Lorsque vous héritez de la DataBoundControlAdapter classe, vous devez, au minimum, implémenter une propriété pour renvoyer une Control instance fortement typée du contrôle, comme indiqué dans la section Exemple

S’applique à

Voir aussi