Freigeben über


IDReferencePropertyAttribute Konstruktoren

Definition

Initialisiert eine neue Instanz der IDReferencePropertyAttribute-Klasse.

Überlädt

Name Beschreibung
IDReferencePropertyAttribute()

Initialisiert eine neue Instanz der IDReferencePropertyAttribute-Klasse.

IDReferencePropertyAttribute(Type)

Initialisiert eine neue Instanz der IDReferencePropertyAttribute Klasse mithilfe des angegebenen Typs.

IDReferencePropertyAttribute()

Initialisiert eine neue Instanz der IDReferencePropertyAttribute-Klasse.

public:
 IDReferencePropertyAttribute();
public IDReferencePropertyAttribute();
Public Sub New ()

Beispiele

Im folgenden Codebeispiel wird veranschaulicht, wie das IDReferencePropertyAttribute Attribut auf eine Eigenschaft angewendet wird, die auf eine Zeichenfolge ausgewertet wird. In diesem Beispiel identifiziert das DataSourceID Mitglied zur Laufzeit ein Datenquellensteuerelement. Mithilfe des parameterlosen Konstruktors wird die ReferencedControlType Eigenschaft auf den Standardwert festgelegt. Control

// This class implements a custom data source control.
public class SomeDataBoundControl : DataBoundControl
{
    [ IDReferencePropertyAttribute() ]        
    new public string DataSourceID {
        get {
            return base.DataSourceID;
        }
        set {
            base.DataSourceID = value;
        }
    }
}
' This class implements a custom data source control.
Public Class SomeDataBoundControl
    Inherits DataBoundControl
    
    <IDReferencePropertyAttribute()>  _
    Public Shadows Property DataSourceID() As String 
        Get
            Return MyBase.DataSourceID
        End Get
        Set
            MyBase.DataSourceID = value
        End Set
    End Property
    
End Class

Hinweise

Wenn Sie diesen Konstruktor aufrufen, wird die ReferencedControlType Eigenschaft auf Control", der Standardwert, festgelegt.

Weitere Informationen

Gilt für:

IDReferencePropertyAttribute(Type)

Initialisiert eine neue Instanz der IDReferencePropertyAttribute Klasse mithilfe des angegebenen Typs.

public:
 IDReferencePropertyAttribute(Type ^ referencedControlType);
public IDReferencePropertyAttribute(Type referencedControlType);
new System.Web.UI.IDReferencePropertyAttribute : Type -> System.Web.UI.IDReferencePropertyAttribute
Public Sub New (referencedControlType As Type)

Parameter

referencedControlType
Type

A Type that specifies the type of the control represented by the property to which the IDReferencePropertyAttribute is applied.

Beispiele

Im folgenden Codebeispiel wird veranschaulicht, wie das IDReferencePropertyAttribute Attribut auf eine Eigenschaft angewendet wird, die auf eine Zeichenfolge ausgewertet wird. In diesem Beispiel identifiziert das DataSourceID Element ein Datenquellensteuerelement und gibt daher den DataSourceControl Typ an.

// This class implements a custom data source control.
public class SomeDataBoundControl : DataBoundControl
{   
    [ IDReferencePropertyAttribute(typeof(DataSourceControl)) ]        
    new public string DataSourceID {
        get {
            return base.DataSourceID;
        }
        set {
            base.DataSourceID = value;
        }
    }
}
' This class implements a custom data source control.
Public Class SomeDataBoundControl
    Inherits DataBoundControl
    
    <IDReferencePropertyAttribute(GetType(DataSourceControl))>  _
    Public Shadows Property DataSourceID() As String 
        Get
            Return MyBase.DataSourceID
        End Get
        Set
            MyBase.DataSourceID = value
        End Set
    End Property
    
End Class

Weitere Informationen

Gilt für: