For Answers, see/post comments

Session c#

Hi Can anybody tell me how to use session ? I have a products page and i only want the logged users to see that page. I have table where i have stored the user_name and password ..

can anyone help by sending the code ?

4 comments:

Anonymous said...

session["name"]=textbox1.text;

this you can get from another page also

Anonymous said...

hi,

Session is a server variable and that's lifespan is throughout the program and we can view it's value in all pages

u can use a session variable as

Session["UserName"] =txt_UserName.Text;

Anonymous said...

hi

session["uname"]=txtname.text

in the next page

call like this

string a = session["uname"].ToString()

Anonymous said...

Session["USERNAME"]=txtUName.text;

String GetUserName=Session["USERNAME"].TOString();