Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making user_information accessible for all pages

Status
Not open for further replies.

balachandar

Programmer
Apr 16, 2001
88
CA
Hi All,
I am new to ASP.NET. Once you a user logs into the web application, I want the following details : User Id,User_Name to be accessible in all pages. However once he closes the session, the information should be lost. What is the best strategy to achieve this functionality.

Regards
Balachandar Ganesan
 
Keep information into session.

In login function add something like :

//C#
Session["User_Id"] = user_id;
Session["User_Name"] = user_name;


And then you can take it from every page by doing:

//C#
string user_name = Session["User_Name"].ToString();
user_id = (int)(Session["User_Id"]);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top