
Having trouble saving array in Session object
I have a similar situation. Once you've assigned a session var = the array,
how can you response.write the elements of the array to see what you've got?
I've tried response.write session("sessionvar(0)"), but never see a value.
Is this not the correct syntax? I've used:
response.write ubound(sessionvar)
. . . to make sure it has values, and it's display a value, the number of
extents, which I've verified is correct. Why is it I can't do the same with
the value of the extents?
Regards -
Quote:
> First page:
> Dim Ipart()
> Redim Ipart(5)
> Session("savedipart") = Ipart
> Second page:
> Dim Ipart '<=== as an ordinary variant, not an array...
> Ipart = Session("savedipart")
> --
> Michael Harris
> Microsoft.MVP.Scripting
> --
> Please do not email questions - post them to the newsgroup instead.
> --
> > I am trying to save an array of values to a session
> > variable and retrieve it in another ASP page. When I do
> > this, I get a type mismatch error, even though the VarType
> > function returns '8204' for both the Session variable and
> > the local array name.
> > Code fragments:
> > First page:
> > Dim Ipart()
> > Redim Ipart(5)
> > Session("savedipart") = Ipart
> > Second page:
> > Dim Ipart()
> > Redim Ipart(5)
> > Ipart = Session("savedipart")<---gives type mismatch error.
> > Am I doing something stupid, or is this not possible?
> > I began by following the example on p. 333
> > of "Professional Active Server Pages 2.0" by Fedorov,
> > et.al., pub by Wrox Press.