First make a serializable class with data members which actually represents the data of the logged in person. Instantiate the class, put the data values and Serialize it in Session. In the target page deserialize the object and bind the data members values to specific controls.
Something like the following piece of code:
1. Create a serializable class
[Serializable]
public class UserData
{
private string _userFirstName;
prvate string _userLastName;
....................
....................
public string FirstName
{
get{return this._userFirstName;}
set{this._userFirstName = value;}
}
.................................
...................
}
2. Serialize the class in the Login.aspx.cs class
if(Authenticated)
{
UserData objUserData = new UserData();
objUserData.FirstName = "John";
objUserData.LastName = "Scott";
..............................
................................
Session.Add("UserData",objUserData);
}
3. Deserialize the object from Session and bind the values to the property in the targeted pages Load method.
protected void Page_Load(object sender, EventArgs e)
{
UserData objUserData = (UserData)Session["UserData"];
lblUserFirstName.Text = objUserData.FirstName;
lblUserLastName.Text = objUserData.LastName;
.............................................
........................................
}
Hope this helps you.