Fabrizio Cipriani
2/24/2007 11:49:00 AM
Is there a way to write data into classic ASP Session and Application objects
from COM? I'm using jscript.net so I cannot use the interfaces available to
other .net languages to access ASP built-in objects.
I know I can get a reference to the ASP context with MTxAS:
var oMTS = new ActiveXObject("MTxAS.AppServer.1");
var objctx = oMTS.GetObjectContext();
So these works fine:
objctx.Item("Response").Write("Calling a method works");
var sesnval = objctx.Item("Session").Contents.Item("ReadingAValueWorks")
But I couldn't find a way to write values into the Session.Contents and
Application.Contents collections, so these won't works:
objctx.Item("Session").Contents.Item("WritingValuesDoesntWork") = "foo";
objctx.Item("Session").Contents.put_Value("WritingValuesDoesntWork", "foo");
objctx.Item("Session").Contents("WritingValuesDoesntWork") = "foo";
(sorry for cross-posting with languages.jscript, i thought the interop group
was more suitable for the question)