I'm using visual studio 2013 and working on a asp web project. Since i'm new to the development, i have this issue.
The scenario is this. when a user login in, since this is a web service based project, apart from the username and passwords the service will return some values. so i have to keep those values such as user name, address, age throughout the application until he log out.
I have tried to keep the values using like this,
public class CONSTANTS
public static String address;
public static String age;
public static String tele;
You can implement this using session Variable as Session Remains different for all Users who Login in your Web Application.
You can store value in Session in your Login buttons click Event as.
Session["username"]=xyz; Session["pass"]=*****; Session["age"]=20;
and you can also retrive values from session whenever Required as.
string uname=Convert.Tostring(Session["username"]); string pass=Convert.Tostring(Session["pass"]);
make sure you need to explicitly cast value in your Desired type as Session return in Object form.