2

I don't know if it's possible, but suppose you want to handle reading/writing of cookies on a classic ASP page from a COM object. The COM object is written in .net and wrapped with a COM interface to make it accessible from classic ASP.

For clarification - my question is this:

Is it possible to access the ASP context inside a .net assembly wrapped with a COM interface, when you access it from a classic ASP Page like this:

Set controller = Server.CreateObject("MyNameSpace.MyClass")
my cookievalue = controller.GetSpecialCookieValue()

This example is an example of accessing the httpcontext's cookie information.

1
  • See my answer to a another asp-classic question here. Commented Jun 16, 2009 at 7:24

1 Answer 1

1

I guess you will need to reference Microsoft Active Server Pages Object Library.

See if this helps.
IMO, you should not set cookies from COM component.

Sign up to request clarification or add additional context in comments.

6 Comments

"you should not set cookies from COM component." Why??
That should better be done in the right context - inside an asp page.
I ended up not accessing the ASP context anyways. I actually was against this from the beginning so... well problem solved :)
@shahkalpesh: Why is ASP page the "right context"? I can't subscribe to this POV. A COM component is merely a means to package some code, I can't see any reason why that code can't deeply coupled with ASP components if that is appropriate to the task of the code. Its often a good choice (assuming you own the server) than leaving that same code in a script language.
@shahkalpesh +1 for linking to the correct KB article. Now it's just a matter of creating a .NET interop wrapper & register it in COM+ to do the trick.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.