G
Guest
I am developing my web apps on a Win XP Pro SP2 laptop and then uploading
them to a Windows Server 2003. My current project involves using session
state variables to keep track of user after they have logged in. The
login.aspx page contains the following code:
if(sAuthorized != "-1" && sAuthorized != "-2")
{
Session["user"] = sAuthorized;
Response.Redirect("index.aspx");
}
Then the index.aspx page contains the following code in the page load event:
string sUserID = Session["user"].ToString();
Now, everything works fine on my laptop, but when I try to run it on the
server I get an "Object reference not set to an instance of an object" error
when it tries to set sUserID equal to the session variable. Any suggestions
would greatly be appreciated. Thanks.
them to a Windows Server 2003. My current project involves using session
state variables to keep track of user after they have logged in. The
login.aspx page contains the following code:
if(sAuthorized != "-1" && sAuthorized != "-2")
{
Session["user"] = sAuthorized;
Response.Redirect("index.aspx");
}
Then the index.aspx page contains the following code in the page load event:
string sUserID = Session["user"].ToString();
Now, everything works fine on my laptop, but when I try to run it on the
server I get an "Object reference not set to an instance of an object" error
when it tries to set sUserID equal to the session variable. Any suggestions
would greatly be appreciated. Thanks.