Results 1 to 4 of 4

Thread: session variables

  1. #1
    Addicted Member
    Join Date
    May 01
    Posts
    153

    session variables

    Guys,

    I want some help regarding maintaining session variables. I am writing Asp.net using C#.

    Once the user logs in to the system using his login and password
    I want to store his settings (line fullname, email id and other
    privileges) in session variables so that I can access them
    throwout the application.

    How do I go about this?
    Last edited by Venkrishna; Mar 25th, 2004 at 09:22 AM.
    there r no alternatives 4 hardwork.

  2. #2
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 01
    Location
    Derby, UK
    Posts
    1,090
    After a successful login you can assign items to session as such
    VB Code:
    1. Session("FullName") = strFullName;
    2. 'or
    3. Session("FullName") = txtName.text; ' using a textbox
    4. Session("Email") = strEmail;
    then to retrieve their values at any point...
    VB Code:
    1. txtName.text = Session("FullName");

  3. #3
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 02
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131
    In C# it is in the format:
    Code:
    Session["FullName"] = strFullName;
    DJ

  4. #4
    Addicted Member
    Join Date
    May 01
    Posts
    153
    thanks guys.
    there r no alternatives 4 hardwork.

Posting Permissions

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