IDReferencePropertyAttribute Konstruktory

Definicja

Inicjuje nowe wystąpienie klasy IDReferencePropertyAttribute.

Przeciążenia

IDReferencePropertyAttribute()

Inicjuje nowe wystąpienie klasy IDReferencePropertyAttribute.

IDReferencePropertyAttribute(Type)

Inicjuje IDReferencePropertyAttribute nowe wystąpienie klasy przy użyciu określonego typu.

IDReferencePropertyAttribute()

Inicjuje nowe wystąpienie klasy IDReferencePropertyAttribute.

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

Przykłady

W poniższym przykładzie kodu pokazano, jak IDReferencePropertyAttribute atrybut jest stosowany do właściwości, która ocenia ciąg. W tym przykładzie DataSourceID członek identyfikuje kontrolę źródła danych w czasie wykonywania. Za pomocą konstruktora bez parametrów ReferencedControlType właściwość jest ustawiona na wartość Controldomyślną .

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

Uwagi

Po wywołaniu tego konstruktora ReferencedControlType właściwość jest ustawiona na Control, która jest jego wartością domyślną.

Zobacz też

Dotyczy

IDReferencePropertyAttribute(Type)

Inicjuje IDReferencePropertyAttribute nowe wystąpienie klasy przy użyciu określonego typu.

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

Parametry

referencedControlType
Type

Element Type określający typ kontrolki reprezentowanej przez właściwość, do której IDReferencePropertyAttribute jest stosowany.

Przykłady

W poniższym przykładzie kodu pokazano, jak IDReferencePropertyAttribute atrybut jest stosowany do właściwości, która ocenia ciąg. W tym przykładzie DataSourceID członek identyfikuje kontrolę źródła danych i dlatego określa DataSourceControl typ.

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

Zobacz też

Dotyczy