C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Give me example for session


Posted Date: 23 Aug 2007      Total Responses: 2

Posted By: Kimo       Member Level: Bronze     Points: 2


Hi

Give me example on session variables.
How to store session variable?
How to retrieve value of session variable?
how can we change value of session variable?
including library directives also.

Thank you




Responses

Author: madhuraj    23 Aug 2007Member Level: SilverRating:     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 2007Member Level: GoldRating:     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();


Post Reply
You must Sign In to post a response.
Next : transfer crystal report data to pdaf in c# getting error?
Previous : How to use session variable with if condition
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

silicone halloween masks

Contact Us    Privacy Policy    Terms Of Use