W
WFB
Hi,
Is it possible to use custom attributes on controls? For example,
If I have the following attribute defined
<AttributeUsage(AttributeTargets.All)> Public Class MyAttribute : Inherits Attribute
Public Message As String
Sub New(ByVal msg As String)
Message = msg
End Sub
End Class
I can "tag" a class with it: <MyAttribute("Hello")> Public Class MyPage : Inherits BasePage
And then in the debugger at run time I can see it using Instance.GetType().GetCustomAttributes(true). Howevr I can not see the attribute if i "tag" a control with it, such as; <MyAttribute("hello")> Protected WithEvents SectionHeader As XYZ.SalesApp.Controls.WebControls.TitleBar, I can not see the attribute.
Is there a reason for this, or a way to work around it?
Thanks
Is it possible to use custom attributes on controls? For example,
If I have the following attribute defined
<AttributeUsage(AttributeTargets.All)> Public Class MyAttribute : Inherits Attribute
Public Message As String
Sub New(ByVal msg As String)
Message = msg
End Sub
End Class
I can "tag" a class with it: <MyAttribute("Hello")> Public Class MyPage : Inherits BasePage
And then in the debugger at run time I can see it using Instance.GetType().GetCustomAttributes(true). Howevr I can not see the attribute if i "tag" a control with it, such as; <MyAttribute("hello")> Protected WithEvents SectionHeader As XYZ.SalesApp.Controls.WebControls.TitleBar, I can not see the attribute.
Is there a reason for this, or a way to work around it?
Thanks