Session Data Lost

  • Thread starter Thread starter Jimmy
  • Start date Start date
J

Jimmy

Hi

I have built a wizard object with Panels in ASP.net. I store data in the
first panel which are used in the second. The Panels contain usercontrols in
which data is stored through Session variables. The problem is that session
data just disappear when I go from the first to the next panel. So for
example in the firstpanel I save the name in a session var:

Session["name"]="Ted";

Then in the next panel try to read it out:
myname = Session["name"];

And then the sessionvariable is empty!

Stepping from one panel to another a postback is executed to retrieve data.
What could be the problem?

ch Jim
 
Is it possible you are trying to read the session data from a panel, before
the other panel had a chance to put it in there? I am guessing there is an
execution flow issue here.
 
Ok I thought about that one and that is not the problem according to the
debugger... It looks more like the session value is reset to NULL because I
get an object reference error all the time!
ch Jim

Marina said:
Is it possible you are trying to read the session data from a panel, before
the other panel had a chance to put it in there? I am guessing there is an
execution flow issue here.

Jimmy said:
Hi

I have built a wizard object with Panels in ASP.net. I store data in the
first panel which are used in the second. The Panels contain usercontrols
in
which data is stored through Session variables. The problem is that
session
data just disappear when I go from the first to the next panel. So for
example in the firstpanel I save the name in a session var:

Session["name"]="Ted";

Then in the next panel try to read it out:
myname = Session["name"];

And then the sessionvariable is empty!

Stepping from one panel to another a postback is executed to retrieve
data.
What could be the problem?

ch Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top