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

Passing ArrayList object from one page to other

Hi Everyone:
I am using ArrayList to store my objects. Currently i am using
session to store this arraylist and when i open showModalDialog [second
page] i reterive this value from session and assign to GridView like
ArrayList list = (ArrayList)Session["values"];

I no longer can use the session. Can someone please tell me how can i
take this object from page to page.

Thanks in advance.

Pargat

Jan 15 '07 #1
2 2420
Hi,

pa**********@gmail.com wrote:
Hi Everyone:
I am using ArrayList to store my objects. Currently i am using
session to store this arraylist and when i open showModalDialog [second
page] i reterive this value from session and assign to GridView like
ArrayList list = (ArrayList)Session["values"];

I no longer can use the session. Can someone please tell me how can i
take this object from page to page.

Thanks in advance.

Pargat
You can use static variables, but with care: Static variables are shared
throughout the whole web application, so you must implement some kind of
session management yourself. If you cannot access Session.SessionID
either, it's going to be tricky.

If you can use the SessionID, you could use a Dictionary<string,
ArrayListto store and retrieve the values.

Also, you must not forget to clean the static variable when the Session
ends, because the framework won't do that for you. If you forget, you'll
have a memory leak. To clean up, use the global.asax (you may have to
add it to your application yourself, it's the "Global Application Class"
in the "Add new item" dialog), and then implement the Session_End
method. Check on Google for examples.

HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Jan 15 '07 #2

pa**********@gmail.com schrieb:
Hi Everyone:
I am using ArrayList to store my objects. Currently i am using
session to store this arraylist and when i open showModalDialog [second
page] i reterive this value from session and assign to GridView like
ArrayList list = (ArrayList)Session["values"];

I no longer can use the session. Can someone please tell me how can i
take this object from page to page.

Thanks in advance.

Pargat
Hi,
it depends on what you're saving in the Arraylist. For example when its
a number of IDs you could transfer them per URL-params. I would use
Shared (Static) objects only when every Session needs access to it.

Regards,
Tim

Jan 15 '07 #3

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

Similar topics

3
by: Celine | last post by:
is it possible to pass an arraylist from one page to another page? If yes how? (I'm using asp.net and c#)
3
by: Stephen | last post by:
I was wondering if someone can help me with an web application design problem. I have a aspx page which builds up an arraylist called addresses and outputs the values in the arraylist items to a...
6
by: Lenn | last post by:
Hi, Could someone clarify my confusion regarding passing reference types to a method with ref keyword and explain when it's practical to use it. It's my understanding that in .NET reference...
8
by: Patrick.O.Ige | last post by:
Hi All, I have a code below:- That Binds a DropDownList to a database using ArrayList. This code works well in ASP.NET webMatrix. But when i use it below in VS.NEt it gives me the error:-...
4
by: Paraki | last post by:
Hi, How to pass the array or arraylist(dataset or any other object in fact) from one page to another. I am using the one page to display 10 records and another page to display and modify the...
3
by: Stephen Travis | last post by:
I'm trying to write a subroutine that will fill an array of some type with several objects of that type. The subroutine works fine if I directly reference the array but if I pass the array as an...
3
by: Mark Jones | last post by:
I am quite new to ASP and .Net development and I am building a web-based multiple choice exam application. The web page displays the questions using a Repeater control and the answers are nested...
0
by: Jeremy Chapman | last post by:
I have included below virtually all the code to a control I'm trying to build. My issue is that an array list property in my control does not get persisted properly to the aspx page code in design...
8
by: =?Utf-8?B?UmF2aQ==?= | last post by:
Hi, I'm trying to pass values of different data-types to a web-service. I thought it would be easier to box these values and pass them as a System.object parameter, like public void...
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...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.