asp session question

C

Chris Barber

VBScript classes don't persist in session variables (unfortunately).

The only way to achieve this is to use WSC, COM component (eg. VB DLL) or
serialise the class object to a string and re-create on each page load.

Chris.

i have write a class in asp

class employee
public employeeId
public teamid
public name

private sub class_initialize()
end sub

private sub class_terminate()
end sub
end class

I have create a new emp class and assign to a session object, but i cannot
using that emp property anymore in other page
example:

1.asp
----------------------------------------
set emp = new employee
emp.employeeId = 1
emp.teamid = 5
emp.name = "Utada P.W. SIU"

set session("employee") = emp


2.asp
------------------------------------------
set emp = session("employee")
'-- either response.write (emp.teamId) or response.write
(session("employee").teamId)
'-- it prompt error as follow
'-- Microsoft VBScript runtime error '800a01b6'
'-- Object doesn't support this property or method: 'teamId'
 
U

Utada P.W. SIU

i have write a class in asp

class employee
public employeeId
public teamid
public name

private sub class_initialize()
end sub

private sub class_terminate()
end sub
end class

I have create a new emp class and assign to a session object, but i cannot
using that emp property anymore in other page
example:

1.asp
----------------------------------------
set emp = new employee
emp.employeeId = 1
emp.teamid = 5
emp.name = "Utada P.W. SIU"

set session("employee") = emp


2.asp
------------------------------------------
set emp = session("employee")
'-- either response.write (emp.teamId) or response.write
(session("employee").teamId)
'-- it prompt error as follow
'-- Microsoft VBScript runtime error '800a01b6'
'-- Object doesn't support this property or method: 'teamId'
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,818
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top