다음을 통해 공유


IDReferencePropertyAttribute 생성자

정의

IDReferencePropertyAttribute 클래스의 새 인스턴스를 초기화합니다.

오버로드

Name Description
IDReferencePropertyAttribute()

IDReferencePropertyAttribute 클래스의 새 인스턴스를 초기화합니다.

IDReferencePropertyAttribute(Type)

지정된 형식을 사용하여 클래스의 IDReferencePropertyAttribute 새 인스턴스를 초기화합니다.

IDReferencePropertyAttribute()

IDReferencePropertyAttribute 클래스의 새 인스턴스를 초기화합니다.

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

예제

다음 코드 예제에서는 특성이 문자열로 계산되는 속성에 적용되는 방법을 IDReferencePropertyAttribute 보여 줍니다. 이 예제에서 멤버는 DataSourceID 런타임에 데이터 원본 컨트롤을 식별합니다. 매개 변수가 없는 생성자를 ReferencedControlType 사용하면 속성이 기본값 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

설명

이 생성자를 호출하면 속성이 ReferencedControlType 기본값인 속성으로 Control설정됩니다.

추가 정보

적용 대상

IDReferencePropertyAttribute(Type)

지정된 형식을 사용하여 클래스의 IDReferencePropertyAttribute 새 인스턴스를 초기화합니다.

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

매개 변수

referencedControlType
Type

Type 적용할 속성이 나타내는 컨트롤의 형식을 지정하는 IDReferencePropertyAttribute A입니다.

예제

다음 코드 예제에서는 특성이 문자열로 계산되는 속성에 적용되는 방법을 IDReferencePropertyAttribute 보여 줍니다. 이 예제에서 멤버는 DataSourceID 데이터 원본 컨트롤을 식별하므로 형식을 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

추가 정보

적용 대상