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. Advertising

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. Max
    Replies:
    1
    Views:
    476
    Joe Kesselman
    Sep 22, 2006
  2. P4trykx
    Replies:
    2
    Views:
    1,804
    bruce barker
    Jan 31, 2007
  3. james_027

    class attributes & data attributes

    james_027, Jun 20, 2007, in forum: Python
    Replies:
    2
    Views:
    367
    Bruno Desthuilliers
    Jun 20, 2007
  4. John Wright

    Custom TextBox with custom attributes and properties question

    John Wright, Feb 27, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    201
    John Wright
    Mar 1, 2004
  5. Kyle Schmitt
    Replies:
    3
    Views:
    185
    Kyle Schmitt
    Jul 24, 2007
Loading...

Share This Page