Last post Dec 07, 2010 09:34 AM by sag_2725
Nov 04, 2010 03:59 AM|sag_2725|LINK
I have developed a custom http handler which calls a WCF service from within. However the parameters to be passed to the service would vary from request to request.
The parameters could be collected by firing an event. The developer can write an eventhandler for the event which will collect the parameters from any where as required and put it into a property exposed by handler.
This event handler could be written on a .cs page which inherits from the original handler.
When request for the page comes to the custom HTTPHandlerFactory I have created, it should create an instance of child class (of custom HTTPHandler) instead of the actual handler class. However, I only have the Type name of child class. The assembly name
in which the type is, is not known as the assembly names keep changing.
I wanted to create an instance of the child class (of custom HTTPHandler ) in Handler factory through reflection and pass it on for processing. But the name of its assembly is not known. Is there a way out?
Thanks in Advance,
Dec 07, 2010 09:34 AM|sag_2725|LINK
Hi everyone, I got the solution. In fact though .net allows to add class file outside the App_Code folder, it is not copiled or does not form part of published website. So I am forced to add my .cs page which inherits from the original handler, in the App_Code.
Have added it in appode folder, the compiled asembly name would be App_Code. The type name I know. So I can load the class at runtime using reflection and create its object.