Session_Start small problem

G

Guest

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!
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top