PDA

Click to See Complete Forum and Search --> : Working with Arrays in Session Obj.


ShIzO
May 3rd, 2000, 08:02 PM
Hi,

i know how to put arrays into Session Object but how do ya assign a value from the array to any object on the page.

---- one page ----

Dim MyArray(20)

MyArray(0) = "a"
MyArray(1) = "b"

Session("TheArray") = MyArray

--- next page ----

Dim MyArray

'i got an error right here!
MyArray = Session("TheArray")


'and here
... name=FirstName value='<% =MyArray(0) %>' ....


--------------------------------
can you please help me, i just started ASP and some things are not just easy. Thx

lychew
May 4th, 2000, 11:25 AM
This works...

<html>
<body>
<%
Dim MyArray(20)
MyArray(0) = "a"
MyArray(1) = "b"
Session("TheArray") = MyArray
%>
<BR><BR>--- next page ---- <BR><BR>

<%
ThisArray = Session("TheArray")
%>
<form>
<input type=text name=FirstName value="<%=ThisArray(0)%>">
</form>
</body>
</html>

type mismatch occur on the next page cause you declare the array.