I have Dim a(15) as integer i wont to save this array in Viewstate .
A:
You just need to assign this variable to ViewState with a given key. Note that when you attempt to access the variable, you will need to cast it to the appropriate type.
Here's a link specific to your question: http://www.kaelisspace.com/wordpress22/2008/04/07/saving-objects-in-viewstate-for-postbacks-vbaspnet/
Tejs
2010-04-28 13:58:08
+1
A:
Save it like this:-
ViewState("MyArray") = a
Access it like this:-
a = CType(ViewState("MyArray"), Integer())
I'm a C# guy might be mistaking in VB.NET code. Please do correct me.
Ismail
2010-04-28 13:58:45
Does't need to cast ViewState("MyArray")
Haroldis
2010-04-28 14:02:00
Thanks for pointing out. I had missed it. Now corrected.
Ismail
2010-04-29 06:10:42