Last post Nov 19, 2012 02:20 PM by mrrogers
Feb 14, 2008 05:33 PM|jrp210|LINK
I am trying to create a class to handle session management but can't seem to get the right syntax to retrieve the session variables from the class. I have this class:
session_ = session;
And in my Master Page.cs I have this code to set the session variables:
mySession.UserTypeId = myUser.UserTypeId;
In my default.cs page I want to print the UsertypeId session variable to the screen. This give me 0 but if I refresh the page it gives me the right UserTypeId.
I think it has to do with me instantiating a new session? How would I get the stored session variable?
Feb 14, 2008 05:50 PM|bcanonica|LINK
This article should help you do what you are trying to do.
Feb 14, 2008 06:56 PM|jrp210|LINK
thanks for the reply but i think that is much more than i care to implement. i am using sql server to store session variables. i'm just trying to get the values from the object once they are stored but can't seem to do so.
Feb 15, 2008 05:56 PM|jrp210|LINK
I found out how to do it. Was missing the static keyword!
Nov 19, 2012 02:20 PM|mrrogers|LINK