By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,806 Members | 1,490 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,806 IT Pros & Developers. It's quick & easy.

Adding an Array to viewstate

P: n/a
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

Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
should be as simple as this..

Dim myArray() As String = {"abc", "def", "ghi"}
viewstate("myarray") = myArray
Dim anotherArray() As String = CType(viewstate("myarray"), String())
"bob" <id*****@hotmail.com> wrote in message news:kZ**********************@twister.tampabay.rr. com...
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


Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.