Mark

Mark

  • NA
  • 1
  • 0

Session Arrays

Jan 14 2006 8:58 AM

I know it's possible to put an array in a session variable, but is it possible to place a structured array in a session variable then be able to retrieve specific members from the structured array and display them on another web page.

Here is my structure

Structure Questionset

Dim question As String

Dim choiceA As String

Dim choiceB As String

Dim choiceC As String

Dim answer As String

End Structure

Here is the code I used to assign the members:

For i=1 to 5

question = CType(dgi.Cells(2).Text, String)

choiceA = CType(dgi.Cells(3).Text, String)

choiceB = CType(dgi.Cells(4).Text, String)

choiceC = CType(dgi.Cells(5).Text, String)

answer = CType(dgi.Cells(6).Text, String)

questions(i).question = question

questions(i).choiceA = choiceA

questions(i).choiceB = choiceB

questions(i).choiceC = choiceC

questions(i).answer = answer

Next

I need to place all of the values in a session array so that when I go to another page, I can retrieve the value of question(1).question, question(2).question, question(3).question, etc...

Is this possible?  Can someone provide the sample code to do this?  Or provide any other suggestions.

Please help with vb.net code since that is the only language I know.