Adding an Array to viewstate

  • Thread starter Thread starter bob
  • Start date Start date
B

bob

I am a newbie. How do I add an array to a viewstate, then retreive the
individual elements?

Right now, I made an array with random numbers and when I go to access an
element from different buttons, if I access
the same element, it looks like it is putting new random numbers in the
array. I just want to establish an array only once with random numbers, and
being able to get the same answers when ever I access the elements of the
array.

Should I put the array in the init or the load page?

TIA
 
should be as simple as this..

Dim myArray() As String = {"abc", "def", "ghi"}
viewstate("myarray") = myArray
Dim anotherArray() As String = CType(viewstate("myarray"), String())
 
Back
Top