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