473,325 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

asp session question

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'
Jul 19 '05 #1
2 1539
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.

"Utada P.W. SIU" <wi******@hotmail.com> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...
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'

Jul 19 '05 #2
o...thx~~

"Chris Barber" <ch***@blue-canoe.co.uk.NOSPAM> wrote in message
news:uU****************@TK2MSFTNGP09.phx.gbl...
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.

"Utada P.W. SIU" <wi******@hotmail.com> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...
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'

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Xizor | last post by:
Let's say I run a server. I have two people using the server. Bill and Joe. Bill is at address.com/bill and Joe is at address.com/joe. Let's say Joe and Bill are both using PHP with sessions on...
1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
3
by: VijayShankar | last post by:
Can u be more specific on your question Anyway its not like Session variables are available for sometime and not available for sometime. When your session starts it is very much available...
1
by: Ernest Forman | last post by:
How can I view the defined Session Variables in the Dotnet environment? I found the session object and it shows me the count of the number of items, but I don't see how to see the names and values...
3
by: Jeff Smythe | last post by:
I simply want to execute some code once when a new session of my ASP.NET application is started (I'm not using session state for anything else - just writing some data to a database). I thought...
4
by: DavidS | last post by:
First: There are several ways to confuse one regarding session timeout. (1) web.config - <sessionState timeout="20"> (2) IIS Manager | Internet Information Services | ServerNode | Default Web Site...
10
by: tshad | last post by:
I have been using the default session state (InProc) and have found that I have been loosing my information after a period of time (normally 20 minutes). Is there anyway to find out how much...
18
by: Rippo | last post by:
Hi I am using role base forms authentication in asp.net and have come across a problem that I would like advice on. On a successful login a session variable is set to identify a user. This is...
5
by: George | last post by:
Hi, Is it possible to delay session creation in ASP.NET I want the user to browse my site without any session created (no cookies set). My pages will know that is Session = null then Session has...
2
by: Kevin Frey | last post by:
Hello, I've been reading that ASP.NET serialises (ie. processes one at a time) HTTP requests if two simultaneous requests need to access the same session state. It also makes note that ASP.NET...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.