Can we intercept to ASP.NET Framework created objects like Page/Controls/User-Controls through Policy Injection/Unity?

Topics: Policy Injection Application Block
Jul 23, 2012 at 6:44 PM
Edited Jul 23, 2012 at 6:49 PM

Hi,

I know that we can implement policy injection on object we create and access using either CREATE or WRAP API of Policy injection Application Block. What about the objects that are created by ASP.NET Framework like Page, Control, WebPart/User Controls etc? If i want to apply policy injection on them, is it possible and how if yes.

Jul 23, 2012 at 10:51 PM

In order to have policy injection performed object creation must be intercepted and a proxy object returned (or an existing object reference wrapped in a proxy object).  Typical ASP.NET interception methods use HttpModules and HttpHandlers.  However, I don't see any way of hooking into the object creation lifecycle for page elements using that technique.

So, I think the answer is no.

This might not help, but ASP.NET MVC provides more opportunities for customization.

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com