IDReferencePropertyAttribute Konstruktorok

Definíció

Inicializálja a IDReferencePropertyAttribute osztály új példányát.

Túlterhelések

Name Description
IDReferencePropertyAttribute()

Inicializálja a IDReferencePropertyAttribute osztály új példányát.

IDReferencePropertyAttribute(Type)

Inicializálja az IDReferencePropertyAttribute osztály új példányát a megadott típussal.

IDReferencePropertyAttribute()

Inicializálja a IDReferencePropertyAttribute osztály új példányát.

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

Példák

Az alábbi példakód bemutatja, hogyan alkalmazza a rendszer az IDReferencePropertyAttribute attribútumot egy sztringre kiértékelő tulajdonságra. Ebben a példában a DataSourceID tag futásidőben azonosít egy adatforrás-vezérlőt. A paraméter nélküli konstruktor használatával a ReferencedControlType tulajdonság az alapértelmezett értékre van állítva. 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

Megjegyzések

A konstruktor meghívásakor a ReferencedControlType tulajdonság Controlértéke az alapértelmezett érték.

Lásd még

A következőre érvényes:

IDReferencePropertyAttribute(Type)

Inicializálja az IDReferencePropertyAttribute osztály új példányát a megadott típussal.

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

Paraméterek

referencedControlType
Type

Az Type a tulajdonság által képviselt vezérlőelem típusát adja meg, amelyre az IDReferencePropertyAttribute alkalmazás történik.

Példák

Az alábbi példakód bemutatja, hogyan alkalmazza a rendszer az IDReferencePropertyAttribute attribútumot egy sztringre kiértékelő tulajdonságra. Ebben a példában a DataSourceID tag azonosít egy adatforrás-vezérlőt, ezért megadja a típust DataSourceControl .

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

Lásd még

A következőre érvényes: