Storing objects in Session

G

Guest

I am trying to persist an instance of my class between asp pages and cannot get it to work consistently. I have one class that implements iEnumerator, that works fine. I have another class that does not implement IEnumerator, I can store the object in Session. When I retrieve it from Session in a different page it behaves as if it's never been created before, I always have to create a new one

I'm thinking it has to do with if a class creates a new class (such as IEnumerator)
 
T

Teemu Keiski

Hi,

can you post the code for your problematic class (simplified will do if it
is long one)

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke

Anthony Reynolds said:
I am trying to persist an instance of my class between asp pages and
cannot get it to work consistently. I have one class that implements
iEnumerator, that works fine. I have another class that does not implement
IEnumerator, I can store the object in Session. When I retrieve it from
Session in a different page it behaves as if it's never been created before,
I always have to create a new one.
 
J

Joey Powell

Double check your index names both in global.asax and in the pages to
make sure they match. This happened to me when I had mispelled one of
them. They have be EXACTLY the same.

Anthony Reynolds said:
I am trying to persist an instance of my class between asp pages and
cannot get it to work consistently. I have one class that implements
iEnumerator, that works fine. I have another class that does not
implement IEnumerator, I can store the object in Session. When I
retrieve it from Session in a different page it behaves as if it's
never been created before, I always have to create a new one.
 

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

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,739
Latest member
Clint8040

Latest Threads

Top