474,039 Members | 2,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp session question

i have write a class in asp

class employee
public employeeId
public teamid
public name

private sub class_initializ e()
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("employ ee") = emp
2.asp
------------------------------------------
set emp = session("employ ee")
'-- either response.write (emp.teamId) or response.write
(session("emplo yee").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 1579
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******@hotma il.com> wrote in message
news:%2******** **********@TK2M SFTNGP11.phx.gb l...
i have write a class in asp

class employee
public employeeId
public teamid
public name

private sub class_initializ e()
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("employ ee") = emp
2.asp
------------------------------------------
set emp = session("employ ee")
'-- either response.write (emp.teamId) or response.write
(session("emplo yee").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.NOS PAM> wrote in message
news:uU******** ********@TK2MSF TNGP09.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******@hotma il.com> wrote in message
news:%2******** **********@TK2M SFTNGP11.phx.gb l...
i have write a class in asp

class employee
public employeeId
public teamid
public name

private sub class_initializ e()
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("employ ee") = emp
2.asp
------------------------------------------
set emp = session("employ ee")
'-- either response.write (emp.teamId) or response.write
(session("emplo yee").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
3015
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 their web pages. Let's say they both create the session variable $_SESSION. Each uses yo for a different purpose. Now we have a user accessing address.com. He goes to Bill's site and his session his started with the $_SESSION created.
1
7798
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: ---------------------------------------------------------------------------- <?php ini_set("session.use_cookies", "off"); ini_set("session.use_trans_sid", "on"); session_start(); $_SESSION = ""; $_SESSION = ""; echo "<form method='POST' action='login.php'>
3
3214
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 unless your session ends One more thing Session variables can very much be used in Application events
1
1447
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 of the items.
3
2129
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 that I could simply put the code in the Session_Start event procedure in Global.asax.cs, however, the event procedure executes and a new session is created every time any page is requested - not just for the first page requested....
4
15491
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 | Properties | Configuration | Options | Enable Session State Session timeout 20 (3) within Global.asax.vb file - Session_Start subroutine can use Session.Timeout=x minutes or (4) within any web page, i.e., <web page>.aspx can use...
10
3536
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 more time I have on a session? If I do a refresh, does reset the session clock? Do you have have to go to another page to reset the session timeout or will a postback also do it? This is important as we have a few pages that a user
18
6907
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 all good as this session variable is used to retrieve data for that user etc. However if I restart the webserver then the users session is lost but the ticket is still active. Therefore the user is not redirected back to the login page.
5
1837
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 not been created and they should not rely on it. But at the moment user puts something into shopping cart i want to trigger session creation (set the cookies) and from no own that user will have regular session. Is it doable with .NET Session or...
2
2919
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 tries to reacquire a lock on the session state every 1/2 second until the timeout is reached, and then it will forcibly release the previous users lock and take the lock for itself. What is this timeout figure?
0
10532
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
12121
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11591
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11983
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7858
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6641
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
5401
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4933
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3951
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.