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. Advertising

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:
    480
    Simon Elliott
    Oct 12, 2004
  2. Simon Elliott

    Lifetime of static objects revisited

    Simon Elliott, Dec 2, 2004, in forum: C++
    Replies:
    5
    Views:
    403
    Simon Elliott
    Dec 4, 2004
  3. Vagif Abilov
    Replies:
    3
    Views:
    18,237
    Laurent Bugnion
    May 24, 2006
  4. Sashko
    Replies:
    1
    Views:
    728
    Joerg Jooss
    Jun 22, 2006
  5. Stefan Ram
    Replies:
    14
    Views:
    532
    James Kanze
    Apr 13, 2009
Loading...

Share This Page