Decorating Derived Page Classes with Custom Attributes
- From: Mark Olbert <ChairmanMAO@xxxxxxxxxxxxxxxxx>
- Date: Sat, 03 Mar 2007 07:55:34 -0800
I've created a couple of custom class attributes to decorate derived Page classes in my ASPNET application. To access them, I use
the following pattern:
[CustomAttribute(some stuff)]
public partial class DerivedPage : BasePage
{
}
public class BasePage : Page
{
public BasePage()
{
CustomAttribute[] attrs = (CustomAttribute[]) this.GetType().GetCustomAttributes(typeof(CustomAttribute), true);
// there are no attributes!!
}
}
This pattern works fine in every Windows Forms app I've ever written that uses custom attributes.
Is there some aspect of ASPNET that prevents it from working?
- Mark
.
- Follow-Ups:
- RE: Decorating Derived Page Classes with Custom Attributes
- From: Walter Wang [MSFT]
- Re: Decorating Derived Page Classes with Custom Attributes
- From: John Saunders
- RE: Decorating Derived Page Classes with Custom Attributes
- Prev by Date: Nested propertiies not set at design time from properties window
- Next by Date: Re: Decorating Derived Page Classes with Custom Attributes
- Previous by thread: Nested propertiies not set at design time from properties window
- Next by thread: Re: Decorating Derived Page Classes with Custom Attributes
- Index(es):
Loading