lifetime of ASP objects

Discussion in 'ASP General' started by Elie Grouchko, May 22, 2005.

  1. Hi All

    I am on page page1.asp and I have a reference to an ASP Vbscript object.

    I need to use Server.Execute("page2.asp") and want to pass a reference to
    this object using a session variable.


    Page1.asp
    <%
    Class Dummy
    Public VarExample
    End Class
    Dim ClassRef
    Set ClassRef = New Dummy
    ClassRef .VarExample = "test"
    Set Session("ClassRef ")=ClassRef
    Server.Execute("Page2.asp")
    %>


    Page2.asp
    <%
    Dim ClassRef
    Set ClassRef = Session("ClassRef ")
    Response.Write(ClassRef .VarExample)
    %>

    I tested it and it works, and I know it also works for COM+ objects but I am
    not if is OK to do it, are there any limitations that I should be aware of ?
    Any possible problems ?

    Thanks

    Elie Grouchko
     
    Elie Grouchko, May 22, 2005
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon Elliott

    lifetime of static objects

    Simon Elliott, Oct 11, 2004, in forum: C++
    Replies:
    7
    Views:
    673
    Simon Elliott
    Oct 12, 2004
  2. Simon Elliott

    Lifetime of static objects revisited

    Simon Elliott, Dec 2, 2004, in forum: C++
    Replies:
    5
    Views:
    545
    Simon Elliott
    Dec 4, 2004
  3. Vagif Abilov
    Replies:
    3
    Views:
    18,474
    Laurent Bugnion
    May 24, 2006
  4. Sashko
    Replies:
    1
    Views:
    930
    Joerg Jooss
    Jun 22, 2006
  5. 7stud
    Replies:
    11
    Views:
    1,062
    Dennis Lee Bieber
    Mar 20, 2007
  6. Prasanna P

    ASP.NET 3.5 AppDomain Lifetime Options

    Prasanna P, Feb 26, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    771
    Norman Yuan
    Feb 26, 2009
  7. Stefan Ram
    Replies:
    14
    Views:
    747
    James Kanze
    Apr 13, 2009
  8. J. Muenchbourg

    asp.net date objects vs. classic asp date objects

    J. Muenchbourg, Oct 3, 2003, in forum: ASP General
    Replies:
    1
    Views:
    290
    msnews.microsoft.com
    Oct 3, 2003
Loading...