I want to create an object which is attached to the specific user session and
I want to be able to access that object directly throughout the Pages, Page
Controls, and Master Pages of the site.
I'm assuming that the best way to do that is to create the object and then
put it into the Session? If so, a few questions about the best way to do that:
1. If I want to reliably access that object on any and every page, how do I
make sure that the object is already in the Session for that user? Do I have
to put logic EVERYWHERE that it's used that says, 'if(Session["MyObj"]==null)
Session["MyObj"] = new MyObj()'?
2. When I access the object from the Session, do I have to 'cast' the object
before I can use it on the pages (e.g. '(MyObj)Session["MyObj"]')?
3. Is there some better way to make the object available throughout the
Session without actually inserting it manually INTO the Session and then
extracting it on every page where it's used?
Alex