473,769 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session_Start small problem

Hi All,
how do u declare a variable as a Collection.Arra yList 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.Arr ayList.ArrayLis t
------------------------------------

Sub Session_Start(B yVal sender As Object, ByVal e As EventArgs)
'Private _ItemsinCart As New Collections.Arr ayList.ArrayLis t
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 1085
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


"ChiWhiteSo x" wrote:
Hi All,
how do u declare a variable as a Collection.Arra yList 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.Arr ayList.ArrayLis t
------------------------------------

Sub Session_Start(B yVal sender As Object, ByVal e As EventArgs)
'Private _ItemsinCart As New Collections.Arr ayList.ArrayLis t
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
1433
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 a Redhat 9 box. The web and MySQL server runs fine, but I have problem with PHP. I have a small php testapplication taken from a MySQL book that accesses a small database. When I point my browser to the php script, I get the following error : ...
3
2899
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 session_start();
3
2212
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 client. MySQL works perfectly. I have created and queried databases with no problem. Apachie 2 appears to work with no problem. I can call up web pages in the expected maner.
5
2178
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. Create a new C# ASP.NET web application named "demo" and modify Session_Start in Global.asax.cs as follows: protected void Session_Start(Object sender, EventArgs e) { Response.Write("Session_Start event fired at "+
0
1252
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 these work. When I transfer my site to my webhost, all of these no longer function within the session_start. All of these functions work correctly when triggered by button clicks or page redirects, the session_start simply won't fire. I have 3...
19
7928
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 limiter - headers already sent in /home/httpd/vhosts/monkeyclaus.org/httpdocs/media/audio/pdsIncludes/CommandStartSession.php on line 14
4
5948
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, however and am really struggling with managing sessions in PHP, based on my experiences with managing sessions in ASP. 99.9% of the feedback I have seen when dealing with the errors has referred to having whitespace before the <?php or after the...
2
4340
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 displayed next. Immediately at this point, it logs out the user. It is logging out the user because after checking $_SESSION == '1' - it finds that its not 1, and therefore displays login section again and a related message. The website is being...
5
7193
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 local server it was working fine but giving some errors those are Notice: Undefined index: phplogin in C:\Inetpub\wwwroot\sampleft\index.php on line 116 Notice: Undefined variable: username in C:\Inetpub\wwwroot\sampleft\index.php on line 116 ...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10211
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
10045
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...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7409
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6673
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
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3959
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
3562
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.