•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 426,126 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,693 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 2720 | Replies: 3
![]() |
•
•
Join Date: Jan 2007
Location: Japan
Posts: 70
Reputation:
Rep Power: 2
Solved Threads: 4
You need to create a Session Object as every time someone visits your site a session is created by default. You can think of the session as a big hashtable with keys to retrieve the contents, one important thing to remember though is that Sessions dont last forever, so if someone left a page open for a long time the session would expire and the stored items would be removed
One simple example of using the Session Object would be:
So there it is, we already added an item to the Session. So now we probably want to look at that again later, a good tip here is that sometimes the Session object expires so always check the session object exists before casting it to its original type:
One simple example of using the Session Object would be:
string test = "test"; Session["mySessionObject"] = test;
So there it is, we already added an item to the Session. So now we probably want to look at that again later, a good tip here is that sometimes the Session object expires so always check the session object exists before casting it to its original type:
if(Session["mySessionObject"] != null)
{
string myVariable = (string) Session["mySessionObject"];
} Last edited by sedgey : Feb 12th, 2007 at 8:23 am.
sedgey: so little daylight, too much caffeine
MCSD MCAD MCSE
http://www.thefriendlybuilder.co.uk,
http://www.sheetmusicdirect.com
MCSD MCAD MCSE
http://www.thefriendlybuilder.co.uk,
http://www.sheetmusicdirect.com
•
•
Join Date: Jan 2008
Location: Largo Florida
Posts: 269
Reputation:
Rep Power: 1
Solved Threads: 23
•
•
•
•
I am newbie,Can anyone post program using state mangement techniques
basically there are four ways to handle state management :
1) viewstate
2) sessionstate
3) cookies
4) database
viewstate provides state management during postbacks
session state provides global variables that you can reach from all the pages in your application domain.
cookies are text files that are kept in the client's harddrive so you can read those during each page request
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Updated : Simple ASP.Net Login Page (ASP.NET)
- Create .aspx page at runtime (ASP.NET)
- Session in app_code (ASP.NET)
- passing session object from login page to next page (JSP)
- How to end a session immediately when the browser closes? (ASP.NET)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
- ASP.NET - session objects Problem (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: Help Needed on creating dynamic content straight from a sql statment
- Next Thread: Hi project dll is not created


Linear Mode