COM access to classic ASP intrinsic objects
Posted
by wrench
on Stack Overflow
See other posts from Stack Overflow
or by wrench
Published on 2010-03-23T15:51:00Z
Indexed on
2010/03/23
15:53 UTC
Read the original article
Hit count: 483
I'm converting a VB6 COM object that works with classic ASP to a c# .Net COM Object
Interop_COMSVCS.ObjectContext objContext;
Interop_COMSVCS.AppServer objAppServer;
objAppServer = null; // need to initialize before using
objAppServer = new Interop_COMSVCS.AppServer();
objContext = objAppServer.GetObjectContext();
oApplication = (Interop_ASP.Application)objContext["Application"];
oSession = (Interop_ASP.Session)objContext["Session"];
oResponse = (Interop_ASP.Response)objContext["Response"];
oRequest = (Interop_ASP.Request)objContext["Request"];
oSession works to store local information to.from ASP storage oResponse can do simple writes to the browser
BUT any code like oRequest.Cookies["sessionId"] or oResponse.Cookies["sessionId"] doesn't provide any sort of read or write access. Any cast or conversion I trry to do tells me I'm dealing with an empty or null System Object. There doesn't seem to be any sort of syntax to get/set the cookie collection.
With COM+ I've seesn soem articles that indcate a switch for Access to ASP Intrinsic Objects -- that seesm to describe my issue, but I'd rather not use COM+. There are also some articles that indicate if I was using ASP.NET I could use HttpContext and HttpRequest/Response, but that's a completely different set of data objects that don't seem to be available with classic ASP.
I've been stuck on this fopr a few days. Any help appreciated.
© Stack Overflow or respective owner