IDReferencePropertyAttribute コンストラクター

定義

IDReferencePropertyAttribute クラスの新しいインスタンスを初期化します。

オーバーロード

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

次のコード例は、文字列に 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

こちらもご覧ください

適用対象