| Author: madhuraj 23 Aug 2007 | Member Level: Silver | Rating: Points: 2 |
hi,
take one example,if u hav a situation to pass value of a textbox from one page to another page.
Session["Name"] = txtName.text; .......................storing name in session variable.
then next u hav to retrive that session variable to another page like this
string strname;
strName = Session["Name"].toString() ; ...........like this u hav to retrive
u can also change the value of session variable like this Session["Name"] = "Madhu";
bye..
|
| Author: vadivukarasi 24 Aug 2007 | Member Level: Gold | Rating: Points: 2 |
Session is automatically created when u are accessing the page
u can assign value or change the session Variable
Session["Username"] ="admin";
to remove all the session variables Session.RemoveAll();
to kill the session
Session.Abandon();
Ater this u can't access the session value
getting values from the session
string s = Session["UserName"].ToString();
|