PDA

Click to See Complete Forum and Search --> : session variables


Venkrishna
Mar 25th, 2004, 08:27 AM
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?

Fishcake
Mar 25th, 2004, 09:55 AM
After a successful login you can assign items to session as such

Session("FullName") = strFullName;
'or
Session("FullName") = txtName.text; ' using a textbox
Session("Email") = strEmail;then to retrieve their values at any point...

txtName.text = Session("FullName");

dj4uk
Mar 26th, 2004, 03:26 AM
In C# it is in the format:

Session["FullName"] = strFullName;


DJ

Venkrishna
Mar 26th, 2004, 04:22 AM
thanks guys.