Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Adding an Array to viewstate

Reply
Thread Tools

Adding an Array to viewstate

 
 
bob
Guest
Posts: n/a
 
      05-03-2004
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



 
Reply With Quote
 
 
 
 
Raterus
Guest
Posts: n/a
 
      05-03-2004
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" <(E-Mail Removed)> wrote in message news:kZtlc.511021$(E-Mail Removed). 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
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with ViewState: "function 'ViewState.get_Item' evaluated and returned null" Steph ASP .Net 2 05-11-2011 02:35 PM
Errors: Failed to load viewstate. & Validation of viewstate MAC failed. sck10 ASP .Net 6 09-01-2006 05:59 PM
Loading usercontrols, viewstate problem, slighly different from all others "viewstate uc problems" please help... ujjc001 ASP .Net 0 07-27-2005 01:52 PM
Viewstate errors... how do I get viewstate working? mark ASP .Net Building Controls 0 02-20-2004 02:17 PM
Corrupted ViewState (Yes, another issue concerning viewstate) Ben Rush ASP .Net 2 12-05-2003 04:17 PM



Advertisments