IDReferencePropertyAttribute Konstruktoren

Definition

Initialisiert eine neue Instanz der IDReferencePropertyAttribute-Klasse.

Überlädt

IDReferencePropertyAttribute()

Initialisiert eine neue Instanz der IDReferencePropertyAttribute-Klasse.

IDReferencePropertyAttribute(Type)

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

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 Element 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 Controlden Standardwert festgelegt.

Siehe auch

Gilt für

IDReferencePropertyAttribute(Type)

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

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

Ein Type, der den Typ des Steuerelements angibt, der durch die Eigenschaft dargestellt wird, auf die das IDReferencePropertyAttribute angewendet wird.

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

Siehe auch

Gilt für