Storing objects in ASP.NET Session

Y

yurps

Hello I have an Employee object which is serializable and has a
generictypeconverter to enable the object to be stored in the asp.net
session....

In my code I am calling procedures by casting the session into the
object and getting properties from it...

UpdateDataBase(
((Employee)Session["EMPLOYEE"]).EmpId,((Employee)Session["EMPLOYEE"]).DeptId
)

It appears that some of these properties are coming out as null even
though they have been set..I can tell because I have place a catch code
which then uses reflection to get the properties of the object.

So I do

if ( ((Employee)Session["EMPLOYEE"]).EmpId == 0 )
ReflectSessionObject();

And I can see that the .EmpId property does have a value...I default it
to zero if it is null....

Does anyone have any recommendations about this kind of coding...?

Thanks,
MAtt
 

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

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top