Hi,
You can rather create class and store all data in object than creating multiple number of session like below
// To Set Into Session
UserData user = new UserData
{
FirstName = FirstNameTextBox.Text,
LastName = LastNameTextBox.Text,
Mobile = MobileTextBox.Text,
Tell = TellTextBox.Text,
Address = AddressTextBox.Text
};
Session["UserData"] = user;
// To Get from Session
if (Session["UserData"] != null)
{
UserData userData = Session["UserData"] as UserData;
string firstName = userData.FirstName;
string lastName = userData.LastName;
//same for mobile,tell and Address
}
UserData(class)
public class UserData
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string Mobile { get; set; }
public string Tell { get; set; }
public string Address { get; set; }
}
I hope this will help you out.