Hi Mr Newbie,
I put the Tokenizer into the session using this:
Tokenizer tokenizer = new Tokenizer();
Session["token"] = tokenizer;
Later on I successfully get the tokenizer back from the session using:
Tokenizer tokenizer = (Tokenizer)Session["token"];
This code exists inside a web control, and all of it works fine. Only when
I access the session on the second page I immediately redirect to, is the
session cleared. I have tried to debug it, and literally on the line of the
redirect, the session contains my value, but doesnt once the new page is
loaded.
Any ideas?
"Mr Newbie" <he**@now.com> wrote in message
news:Oc**************@tk2msftngp13.phx.gbl...
Are you sure that tokenizer was not null before you saved it ?
"John" <jr******@hotmail.co.uk> wrote in message
news:eF**************@tk2msftngp13.phx.gbl... Hi,
I do a Response.Redirect(page), and on the second page I have redirected
to, I get an object out of the session (or at least I attempt to). Just
before the redirect I do:
Session["token"] = tokenizer;
On the redirected page, in PageLoad I do:
Tokenizer tokenizer = (Tokenizer)Session["token"];
But the tokenizer is null, because the session is cleared. This is a
default web application, so I am not sure why it isnt working.
Any advice?
John.