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'
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'