We did a similar thing in a former project, and it worked fine. However, objects in session do not keep their type (as so far as I've seen). By that I mean the session object won't recognize any attributes/methods in intellisense.
i.e.
my object has a LoadMe() function. If I instantiated the object, I could go
MyObject.LoadMe()
But if its in session, the .LoadMe() won't show up in intellisense, so I can either:
a) remember it and hard code it
Session("myObject".LoadMe()
or
b) cast the object within another object as soon as that page loads, and use the session as merely a transportation device
i.e.
page1:
Dim myObj as new object
Session("myObj" = myObj
Response.redirect("Page2.aspx"
page2:
Dim myObj as new object
myObj = Session("myObj"
If you use the session only for transportation, then you don't have objects sitting in memory using up resources.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.