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

Cannot store arraylist in session

Hi there,

I cannot store an arraylist in a session. I have read some posts and
still found no solution. I am sure it might be something simple, but
since I have been around it for quite sometime I ask for your advice.

Here is my page load.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load

If Not Page.IsPostBack Then
Dim users As New ArrayList
users = User_.ArrayOfUsers ' This gets an array of
users. (User_ is just an object)
Session.Add("users", users)
Session.Add("i", 0)

i = 0
details =
User_.UserID_Image_Thumbnail_LastCheck_Rating_Numb erOfVotes(users.Item(i))
Image.ImageUrl = details(1).ToString
lblLastChecked.Text = details(3).ToString
details.Clear()
users.Clear()
Else
i = CType(Session("i"), Integer)
Dim users_tmp As New ArrayList
users_tmp = CType(Session("users"), ArrayList) ' Why is
this empty?!?! I cannot understand...

detailsAfterRating =
User_.UserID_Image_Thumbnail_LastCheck_Rating_Numb erOfVotes(users_tmp.Item(i))
details =
User_.UserID_Image_Thumbnail_LastCheck_Rating_Numb erOfVotes(users_tmp.Item((i
+ 1)))

Image.ImageUrl = details(1).ToString
lblLastChecked.Text = details(2).ToString

RatedImage.ImageUrl = detailsAfterRating(2).ToString
lblRating.Text = detailsAfterRating(5).ToString
lblPastRate.Text = yourRating.ToString
i = (i + 1)
Session.Add("i", i)
details.Clear()
detailsAfterRating.Clear()
End If
End Sub

Mar 29 '07 #1
1 1045
I was also told that I am doing a reference to the arraylist and not
storing the values itself. But how can I solve that if next time the
page loads that reference will not exist anymore. Is there a way to
store the values themselves?

Tks again.

R

Mar 29 '07 #2

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

Similar topics

8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
7
by: simon | last post by:
First, I create arrayList and put it into a session. (should I use arrayList to store different types of data into collection or should I use something else?) ArrayList arrayValues = new...
1
by: Marc Bishop | last post by:
can anyone help me with this? Code Snippet: Dim ArrCart As New ArrayList() if NOT Session("sesCart") = "" then ArrCart = Session("sesCart") Error: System.InvalidCastException: Operator is...
3
by: Sukh | last post by:
I have to design a "Online Test Application" and application is going to display question and answers.All the questons are objective type so there is four answer for each question. My Question is...
6
by: fniles | last post by:
I am using VB.NET 2003 and a socket control to receive and sending data to clients. As I receive data in 1 thread, I put it into an arraylist, and then I remove the data from arraylist and send it...
11
by: john_c | last post by:
I'd like to store information for roles in Session variables. RoleA has a specific set of values, RoleB has a specific set and so one. When I access values for RoleA, it looks like this: ...
3
by: ricardo.sobral.santos | last post by:
Hi there, I cannot store an arraylist in a session. I have read some posts and still found no solution. I am sure it might be something simple, but since I have been around it for quite sometime...
0
by: Laila2008 | last post by:
Hi, I need to add a 'WebDialog' component on to a webpage everytime a user clicks on a button. This is the error I'm getting: Cannot unregister UpdatePanel with ID 'dialog0_UpdateContainer'...
3
by: tedpottel | last post by:
Hi I cannot get sessions to work. I have the following code </body> <? session_start(); $counter++; print "You have visited this page $counter times during this session";...
8
by: adarshyam | last post by:
hi.. I am new to vb.net i am doing a program using dynamic textboxes which involves two pages .. where values of textboxes in one page must be transfered to to other sex of textboxes in another page,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.