473,396 Members | 1,898 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,396 software developers and data experts.

How to Utilize Session State to Hold and Add Values to an Arraylist?

RLindahl
Greetings,

What I am trying to do is take input from a webform's textbox and place this in an arraylist (on button click) that holds mutliple inputs. I have it working that viewstate holds the first item I select but if I choose a second it replaces the first instead of adds to it. Research I've done would suggest that I need to use a session state to hold the array list however, I'm not sure how to utilize this properly.

I'm not sure what is necessary to show but here is my storage button click event thus far (Language is VB):
Expand|Select|Wrap|Line Numbers
  1. Protected Sub StoreBtn_Click(sender As Object, e As System.EventArgs) Handles StoreBtn.Click
  2.  
  3.         Dim saveResult As String = txtResult.Text
  4.  
  5.         Dim elementCount As Integer = arraylistSave.Count
  6.  
  7.         If elementCount <= 9 Then
  8.  
  9.             arraylistSave.Add(saveResult)
  10.         Else
  11.             arraylistSave.Clear()
  12.             arraylistSave.Add(saveResult)
  13.  
  14.         End If
  15. End Sub
  16.  
Any insights or direction would be greatly appreciated.

My Best,

RL
Feb 21 '13 #1
2 1199
I guess I was a bit quick to post here,I found my own solution.

Thanks.
Feb 22 '13 #2
Rabbit
12,516 Expert Mod 8TB
Can you please post your solution in case someone else runs into the same problem?
Feb 22 '13 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: WJ | last post by:
I have problem in using "Deserialization" method to work with SQL Session State. The session state data was recorded properly to MS/SQL Server ASPState by a web application. I then attempted to...
6
by: Jason | last post by:
Is it possible to store an entire datatable/dataset in session state? If so, could someone please provide a code snippet or a link to documentation for me please? (I'm having no luck at all) ...
13
by: Leszek Taratuta | last post by:
Hello, I have several drop-down lists on my ASP.NET page. I need to keep data sources of these lists in Session State. What would be the most effective method to serialize this kind of data...
1
by: Johan Nedin | last post by:
Hello! I have a problem with SQLSession state on my ASP.NET pages. SQLSession state behaves very different from InProcess session state, which I think is very bad. I can understand some of...
5
by: Sean | last post by:
Problem with sessions I have created an application without concern for sessions. As it turns out I think that might be my undoing. What I have: I have an online quiz. I don’t need to know...
0
by: Paul Russo | last post by:
I am using the Report Viewer Web Control in Asp.Net 2.0. We are utilizing SQL Server Session state. We would like to use cookieless session state, however, the report viewer controls display an...
0
by: none | last post by:
Hi, I've got a problem with losing session state in ASP.NET version 2. It does it intermittently - sometimes it tanks - and sometimes it works OK. I've got the ASP.NET state service started...
6
by: KevinGravelle | last post by:
What is wrong with this picture? I'm trying to set my shopping cart text on my home page using the following function that is executed when the class is constructed: protected string...
0
by: dities13 | last post by:
Hello all and thank you for your time. We have a 3rd party application written for my office (vb.net 2.0 framework). However, we are getting reports of slow response time and do not believe it...
1
by: dities13 | last post by:
Hello all and thank you for your time. We have a 3rd party application written for my office (vb.net 2.0 framework). However, we are getting reports of slow response time and do not believe it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.