Hi guys

I can used arraylist.I want to use that arraylist values in many places of my pages ..

i putting arraylist values in session state .

if my page is postback that arraylist getting values are incorrect,until page is not postbak arraylist getting correct value.


whats problem in page..

how to store arraylist value in session or viewstate ...with page is postback and not post back condition..


reply me

Recommended Answers

All 2 Replies

I'm not really sure if I understand your question...

If you write a Sub to add/modify an ArrayList to the SessionState, it should save it. You must postback to get the correct values saved to session state. If you just use a hyperlink, for instance, to go to another page, it might not postback, but instead, just go to the other page.

Make sure when you go to another page, it's either after you've done a PostBack to save session state. However you do it, it's going to be required to get the correct values in there. The server doesn't know you've made a change to the state if you don't post back.

You need to Serialize it I think...maybe use the server's session instead.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.