Custom Attributes (AttributeTargets.Property) and Property Type

Discussion in 'ASP .Net Building Controls' started by Zarko Gajic, Apr 7, 2005.

  1. Zarko Gajic

    Zarko Gajic Guest

    Hi

    I've create a custom attribute class "MyAttribute" with
    [AttributeUsage(AttributeTargets.Property)]

    Is there a way to get the type of the property myAttribute is applied to?

    I need to raise an exception if "MyAttribute" is attached to a non-string
    type of property, for example. In other words I have to make sure
    MyAttribute does not only targets properties but also string properties.

    ~Zarko Gajic
     
    Zarko Gajic, Apr 7, 2005
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Earl Teigrob
    Replies:
    4
    Views:
    618
    Earl Teigrob
    May 19, 2004
  2. Anabela Silva
    Replies:
    0
    Views:
    1,543
    Anabela Silva
    Nov 1, 2006
  3. P4trykx
    Replies:
    2
    Views:
    2,116
    bruce barker
    Jan 31, 2007
  4. castironpi

    custom allocation and custom type

    castironpi, Aug 4, 2008, in forum: Python
    Replies:
    0
    Views:
    446
    castironpi
    Aug 4, 2008
  5. John Wright

    Custom TextBox with custom attributes and properties question

    John Wright, Feb 27, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    352
    John Wright
    Mar 1, 2004
  6. Rob Joosen

    Keep custom property-value in custom rendered control

    Rob Joosen, May 12, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    261
    Rob Joosen
    May 12, 2004
  7. anon
    Replies:
    0
    Views:
    313
  8. Curt_C [MVP]

    Custom WebControl, custom property list

    Curt_C [MVP], Sep 1, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    297
    Curt_C [MVP]
    Sep 1, 2005
Loading...