Monday, March 26, 2012

Maintain List Object

I have a List of Objects placed into a System.Collections.Generic.List.

I populate this from a web service on page load. The list populates a listbox and a user selects one of the items in the listbox which in turn populates textboxes with the contents of the the particualr object in the list.

I want to maintain the List during postback rather than having to re populate it. I cannot put the list of objects into cache, session or a cookie.

Is there any other way I can persist the list of objects between postbacks? Was thinking of setting the list variable as static but dont think its very secure so ruled it out also!

Any ideas?

Hi,

you can use ViewState instead which'll travel upon every postback back and forth.

Grz, Kris.

0 comments:

Post a Comment