Hi there,
I am doing some nifty research in my search for an optimal solution in regards to dynamic server transfers to classes implementing the IHttpHandler interface, and for this, I would like to experiment with the in title specified method signature.
When I look in the MSDN documentation, I have my normal trivial implementation where you specify a page (string), but the one I found interesting is this one:
public void Transfer(
IHttpHandler handler,
bool preserveForm
)
Parameters
handler
Type: System.Web.IHttpHandler
The HTTP handler that implements the IHttpHandler to transfer the current request to.
preserveForm
Type: System.Boolean
true to preserve the QueryString and Form collections; false to clear the QueryString and Form collections.
Actually, it meets my requirements, but I am unsure how to call it, as it keeps throwing exceptions when I try to specify an IHttpHandler compatible class.
This thread implies, that it is a design bug from Microsoft: http://www.netnewsgroups.net/group/microsoft.public.dotnet.framework.aspnet/topic16650.aspx
Quote:
"Executes the handler for the specified virtual path in the context of the current request."
I trust, there is no reason to prohibit IHttpHanlder derived classes. See Reflected code of HttpServerUtility.ExecuteInternal:
.... else if (!(handler is Page)) {
error = new HttpException(0x194, string.Empty); } ....
handler.ProcessRequest(...) // BUT It's only for Page instances ((( .... object[] objArray2 = new object[] { handler.GetType().ToString() } ; throw new HttpException(SR.GetString("Error_executing_child_request_for_handler", objArray2), error);Just remove this first 3 lines of code from assembly.. but I am not MS employee :)
Can anyone provide me with a working sample, using the method signature described; it would be much appreciated!