views:

45

answers:

1

On the page load event of my webpage i fill the list of with the contents of the structure

Structure MainStruct
        Dim Ans1 As String
        Dim Ans2 As String
 End Structure


Dim Build As New List(Of MainStruct)

The problem i that on post-back the contents of the list-of get lost.

So, how can i preserve the contents of the list-of in ASP.NET?

A: 

You can either put it in a session or a viewstate in case you donot wish to keep in a storage like database or a ASP.net cache. Of course, you shall have to be careful if you keep it in session as you shall have to clean it up as soon as you go out of scope. Also, serialising/deserialising will be another angle. Can't you have some global cache or so for your app?

Kangkan