ASP/VB - OnStartPage & ScriptingContext?

I have a Webclass WebClassA which is instantiated from an ASP page via the WebClassManager. WebClassA then instantiates another class ClassB, which is just a normal class, not a webclass. I need ClassB to have access to ASP's ScriptingContext so I can use the Server and Response objects.

So in ClassB I make a call to ..

Set oServer = GetObjectContext.Item("Server")

... to grab a handle to the server. This works fine when the DLL is compiled, but it's no use when I'm just running it through the VB IDE. I want to set a "DEBUG" compiler conditional so that I can just set this flag when debugging to make a different call to ...

Public Sub OnStartPage(PassedScriptingContext as ScriptingContext)
Set oServer = PassedScriptingContext .Server
..
End Sub

... in the "OnStartPage" of the class.

The problem here is that OnStartPage is ONLY called when the class is instantiated from ASP. My class is instantiated from a WebClass, not an ASP page. Does anyone know of a way to grab a hold of the ASP ScriptingContext in debug mode other than GetObject() and OnStartPage? Or better yet, does anyone know of a way to force the compiler to call OnStartPage when a class is instantiated, regardless of where from?

View Replies


ADVERTISEMENT

ScriptingContext .asp Page From VB Component

I am writing a VB component. I want to make a request to hello.asp page from VB component. I am using Scriptinc Context for that. How can I make a request so that I can get a response back from my asp page...

So far I have written only these lines...

Dim ASPsc As ScriptingContext
Set ASPsc = ASP_Scripting_Context

How to make a request and get the response?

View Replies View Related

ScriptingContext :: Function Of Interface Marked As Restricted

I'm having a problems when trying to make a DLL in VB6. The code is using ScriptingContext to access the Cookies-collection from the asp-pages, but when I try making the DLL I get the following error-message:

**************
Compile error:
Function of interface marked as restricted, or the function uses an
Automation type not supported in Visual Basic.
**************

When I click OK, ScriptingContext.Request.Cookies is marked. Could anyone please help me with this problem? I'm more of a .NET guy but some of the applications that I'm in charge of are still using ASP and COM+ so unfortunately I'm not too familiar with these techniques.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved