Results 1 to 2 of 2

Thread: [RESOLVED] Access the Session in a class

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Resolved [RESOLVED] Access the Session in a class

    I have added a class to my project and can't access the Session variable. How can I get access to it?

    I have a SqlDatabase class which reads my connection string from ConfigurationSettings.AppSettings("dbCon") and that works fine. I have a login page to get the userid and password to store in the Session. On every page I have to copy a function that reads the userid and password from the Session and passes it to the class. I want to avoid this by being able to access the Session from my class.
    Last edited by wey97; May 17th, 2005 at 08:46 AM.

  2. #2
    Addicted Member
    Join Date
    Aug 2004
    Location
    Cape Town, South Africa
    Posts
    149

    Re: Access the Session in a class

    HttpContext.Current.Session.Item("userid")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width