Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: Cannot store arraylist in session - Please help

Reply
Thread Tools

Re: Cannot store arraylist in session - Please help

 
 
pvdg42
Guest
Posts: n/a
 
      03-29-2007
I'm going to try to crosspost this to the ASP.NET group.

<> wrote in message
news: oups.com...
> 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
>



 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      03-29-2007
after adding a ref to users to session, you call users.Clear() to clear
it, so on postback its empty.

-- bruce (sqlwork.com)

pvdg42 wrote:
> I'm going to try to crosspost this to the ASP.NET group.
>
> <> wrote in message
> news: oups.com...
>> 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
>>

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Does the clone() method of ArrayList<> make a copy of the objects in the ArrayList? xz Java 16 08-04-2007 10:33 PM
Cannot store arraylist in session ricardo.sobral.santos@googlemail.com ASP .Net 3 03-29-2007 08:52 AM
a class inherited from ArrayList, is saved to ViewState, why the type of the object read from ViewSate is not the class, but the parent, ArrayList leal ting ASP .Net 1 02-10-2004 07:45 PM
writeObject with ArrayList of ArrayList? Kaidi Java 4 01-03-2004 08:16 PM
Iterate through ArrayList using an another ArrayList Saravanan Rathinavelu ASP .Net 3 08-19-2003 07:03 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57