Hi there,
I have written code to automatically assign event handlers to controls of a certain type, at runtime - using "Addhandler".
I would like to use this same code for other pages, and am battling to do this. I have created a separate class for shared code, but cannot get this code to function properly in this environment.
The code for adding delegates, as well as the event handling code itself, loops through controls on the page.
The context of the current page, and the objects on it, need to be accessible.
This no longer works when I put the code into a class, and refer to it from my code behind page. I think the scope of the current page is lost..?
Any ideas? Any ways where this code can be shared amongst multiple pages?
Thanks for your time!
I have written code to automatically assign event handlers to controls of a certain type, at runtime - using "Addhandler".
I would like to use this same code for other pages, and am battling to do this. I have created a separate class for shared code, but cannot get this code to function properly in this environment.
The code for adding delegates, as well as the event handling code itself, loops through controls on the page.
The context of the current page, and the objects on it, need to be accessible.
This no longer works when I put the code into a class, and refer to it from my code behind page. I think the scope of the current page is lost..?
Any ideas? Any ways where this code can be shared amongst multiple pages?
Thanks for your time!