Can anyone tell me whether it is possible to pass the Response object from classic asp to a C# class library and if so how it is done.
I’m using C# 2010 express and JScript in ASP, but I’ll take a VBScript answer.
Or if there is another way of outputting to the http context of the classic asp page from a dll, that’ll also do.
I thinking that it can’t be done as the System.Web.HttpResponse object doesn’t seem to be available from a class library.
Thank you to those who responded. By way of a complete answer for anybody else that may have the same question, here is some sample code:
public string passObj(ASPTypeLibrary.Response r)
{
r.Write("text from DLL");
return "OK";
}
and on the classic asp side of things:
var x = Server.CreateObject("dllTest.test");
x.passObj(Response);
To access the classic ASP objects including Response, you can add a COM reference in your C# project to “Microsoft Active Server Pages Object Library”.
You can then reference it from C# as: