I have the following classes and I need to know if DocPage class have the attribute SessionRequired into the method Render():
public class DocPageBase
{
void Render()
{
// Have extended class SessionRequired?
}
}
[SessionRequired]
public class DocPage : DocPageBase
{
// Some properties and methods
}
Thanks for your help!
Regards,
Gerard
You'd use
GetType()
to get the actual type, and thenType.IsDefined
to check for the presence of the attribute.