IDReferencePropertyAttribute Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the IDReferencePropertyAttribute class.
Overloads
IDReferencePropertyAttribute() |
Initializes a new instance of the IDReferencePropertyAttribute class. |
IDReferencePropertyAttribute(Type) |
Initializes a new instance of the IDReferencePropertyAttribute class using the specified type. |
IDReferencePropertyAttribute()
Initializes a new instance of the IDReferencePropertyAttribute class.
public:
IDReferencePropertyAttribute();
public IDReferencePropertyAttribute ();
Public Sub New ()
Examples
The following code example demonstrates how the IDReferencePropertyAttribute attribute is applied to a property that evaluates to a string. In this example, the DataSourceID
member identifies a data source control at run time. By using the parameterless constructor, the ReferencedControlType property is set to the default value, 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
Remarks
When you call this constructor, the ReferencedControlType property is set to Control, which is its default value.
See also
Applies to
IDReferencePropertyAttribute(Type)
Initializes a new instance of the IDReferencePropertyAttribute class using the specified type.
public:
IDReferencePropertyAttribute(Type ^ referencedControlType);
public IDReferencePropertyAttribute (Type referencedControlType);
new System.Web.UI.IDReferencePropertyAttribute : Type -> System.Web.UI.IDReferencePropertyAttribute
Public Sub New (referencedControlType As Type)
Parameters
- referencedControlType
- Type
A Type that specifies the type of the control represented by the property to which the IDReferencePropertyAttribute is applied.
Examples
The following code example demonstrates how the IDReferencePropertyAttribute attribute is applied to a property that evaluates to a string. In this example, the DataSourceID
member identifies a data source control and therefore specifies the DataSourceControl type.
// 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
See also
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기