473,404 Members | 2,114 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,404 software developers and data experts.

Session_Start small problem

Hi All,
how do u declare a variable as a Collection.ArrayList in a Session_start at
the Global.asax file?

im having some problems in declaring the arraylist at session_start in
global.asx,

so how do u exactly write it?
vb doesnt recognize it if i write somethin like:
------------------------------------
Private _ItemsinCart As New Collections.ArrayList.ArrayList
------------------------------------

Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
'Private _ItemsinCart As New Collections.ArrayList.ArrayList
End Sub

Cozi need the ItemsinCart variable to be able to access it from all my
other classes.

Thanks a mucho!
Jan 30 '07 #1
1 1072
Do it in the first page the user gets to see, not in the Session_Start event.

e.g.,

Page_Load (xx,xx)
{
if (Session["itemsCart"]==null)
{

ArrayList alItems = new ArrayList();
Session["itemsCart"]=alItems;

}
}

-- Thats C# up there but i imagine you get the idea.
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"ChiWhiteSox" wrote:
Hi All,
how do u declare a variable as a Collection.ArrayList in a Session_start at
the Global.asax file?

im having some problems in declaring the arraylist at session_start in
global.asx,

so how do u exactly write it?
vb doesnt recognize it if i write somethin like:
------------------------------------
Private _ItemsinCart As New Collections.ArrayList.ArrayList
------------------------------------

Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
'Private _ItemsinCart As New Collections.ArrayList.ArrayList
End Sub

Cozi need the ItemsinCart variable to be able to access it from all my
other classes.

Thanks a mucho!
Jan 30 '07 #2

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

Similar topics

0
by: ZoombyWoof | last post by:
Hi. I'm very new to PHP so this may be a dumb question, but I'm stuck. I have just compiled and installed the latest and the greatest versions of Apache (2.0.48), PHP (4.3.3) and MySQL (4.0.15) on...
3
by: Florence HENRY | last post by:
Hello, I've searched about my problem on google before posting, but I didn't find anything relevant... I have a problem with session_start. Here is my code : <html> <head> <?php...
3
by: Trogdor | last post by:
I set up a server on an AMD 650 machine running gentoo linux. I installed Apachie 2, MySQL 4.1 and PHP 4.3.11 I use another computer on my local net (192.168.0.x) to access the server as a...
5
by: Niklas Uhlin | last post by:
Someone please explain why Session_Start fires multiple times / retains SessionID values between sessions, when you open an ASP.NET page from MS Word. For details of the problem, see below: 1....
0
by: Jason Lehman | last post by:
When testing on my local machine, the session_start fires fine. I try storing a value to my database, creating a timestamped text file, and writing a line of text to a general log file. All of...
19
by: lawrence k | last post by:
How can I find out where my script is outputting to the screen for the first time? My error logs are full of stuff like this: PHP Warning: session_start(): Cannot send session cache...
4
by: three-eight-hotel | last post by:
I'm somewhat of a newbie to PHP coding, but have developed a site using the technology, and have been pleasantly surprised by the capabilities offered. I am more comfortable in the ASP world,...
2
by: jwhite68 | last post by:
The essence of my problem is this. 1. I login to my website with user/password. 2. I select any option, which effectively re-calls index2.php with some additional parameters, to control whats...
5
by: siyaverma | last post by:
Hi, I am new to php, i was doing some small chnages in a project developed by my collegue who left the job and i got the responsibility for that, After doing some changes when i run it on my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.