Results 1 to 2 of 2

Thread: Working with Arrays in Session Obj.

  1. #1

    Thread Starter
    Addicted Member ShIzO's Avatar
    Join Date
    Apr 1999
    Location
    Bartlett, IL
    Posts
    189
    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

  2. #2
    Lively Member
    Join Date
    Aug 1999
    Posts
    89
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width