You can apply attributes to any construct specified in AttributeTargets.
The thing is, they don't automatically execute, as they are merely
attributes. Certain attributes appear to do so (like
SoapExtenstionAttribute and ContextAttribute) because a superclass has a
method call that introspects the construct to search for appropriate
attributes of a certain type and acts upon them. So, to make a long story
short, the only way you can have certain web pages execute an attribute is
to insert it into an already-existing attribute-checking infrastructure
(again, SoapExtensionAttribute is a fine example, as the web service
superclass automatically looks for SoapExtentionAttributes)
Another avenue is to put some code to look for and deal with attributes in
some central method call (an MSDN search for SqlParameterAttribute will
produce an article illustrating this)
"Zviki Goldberg" <zv****@matrix.co.il> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi All...
I have a Auditing system. I want to send Audit messages using attributes.
I managed to activate the ContextAttribute object, BUT it forced me to
inherit from ContextBound object (which is too much for me, cause I want to use
this attribute auditing also in web pages).
Is there any option to do so ?
Maybe the solution is somewhere in the Demand staff (.NET rle base
security).... How is that check enabled ??
Thanks a lot,...
Zviki.