I was wondering if there was a way to use policy injection in ASP.net pages, specially in control event handlers. ASP.Net engine creates page instances, so in order to do what I want there would have to be a way to instruct ASP.Net engine to create
page instances using the policy injection factory create method instead of the new operator. Also it would be necessary to rewire controls and page event listeners so they'll point to the proxy created with the factory create method and not to some "pure"
instance of the page class. Am I missing something and this is far less complicated than I've imagined? If not, is there a way to intercept Asp.Net engine in such a way?
Thanks a lot in advanced.
Hi there again,
I've been thinking and maybe I've got a solution.
public class MyOwnPage : System.Web.UI.Page, IMyOwnPage
public void button_onClick(object sender, EventArgs args)
public interface IMyOwnPage
void button_onClick(object sender, EventArgs args);
Of course, it would take an interface for every page class but I think this is a simple way to take advantage of policy injection in Asp.Net pages without bypassing or modifying Asp.Net engine. As a matter of fact I think this is a cute way to shield client
code from the need to use the Policy Injection Factory to create or wrap objects, objects wrap themselves when there's need. I'm only worried with the posible overhead costs of wrapping the object each time. Is it to serious?
Anyway, if someone knows a solution that involves modifying or bypassing ASP.Net engine, I'd like to know.
Thanks a lot again.