A truly desperate question about ScriptingContext/

Results 1 to 3 of 3

Thread: A truly desperate question about ScriptingContext/

  1. #1
    Join Date
    Dec 1969

    Default A truly desperate question about ScriptingContext/

    I have an object with several classes. Not all these classes are called directly from an ASP-page. However, most classes do need access to the ASP-intrinsic objects.<BR><BR>The ScriptingContext nor the ObjectContext provide a solution because they are only available to a class when it was called directly from an ASP-page.<BR><BR>Now, if only 2 of the 5 classes are actually called from an ASP-page I can only use the ASP-instrinsic objects in these 2 classes. But I need them in all 5 of them! How? <BR><BR>Are there other functions in Visual Basic that provide the functionality to query a URL or read from a cookie?<BR><BR>I’m desperate because I don’t want to flush my huge project through the toilet just because I can’t use the ScriptingContext or ObjectContext.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: A truly desperate question about ScriptingCont

    What I believe you can do is this: when your ASP creates an object, that object can use ObjectContext to get references to the intrinsic ASP objects. If this object then creates another object, you can pass it a reference directly to the ASP object you need in that object&#039s constructor, without going anywhere near ObjectContext in the second object.<BR><BR>HOWEVER, the fact that all of your objects need to access the intrinsic ASP objects worries me - these sort of operations aren&#039t renowned for speed and efficiency. You might want to review your design to see if you really need to use the ASP objects across the board, or can you have one or two classes that interact directly with ASP and just pass the necessary information into your other classes? For example, I wouldn&#039t expect a pure data-access component to need to use the ASP objects.<BR><BR>Dunc

  3. #3
    Christiaan Guest

    Default RE: A truly desperate question about ScriptingCont

    To transfer the scriptingcontext to another class, use Server.CreateObject when you create that class. Also, do not use Server.CreateObject (in a VB-class) to create non MTS-objects such as ADO-recordsets and the FSO.<BR><BR>Server.CreateObject creates the class with a new context (and the 5 ASP-objects). This is not the fastest way. You should use the objectcontext instead to create the context for the class. The objectcontext can create the 5 ASP-objects without requiring an existing scriptingcontext.<BR><BR>But, i guess you&#039re using a combination so you can debug with the SC and move to the OC when you&#039re done debugging.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts