By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,119 Members | 2,064 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,119 IT Pros & Developers. It's quick & easy.

Session_Start small problem

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.