Session application viewstate
Basic questions / ans. for beginners
1. What is session?
Ans. Session is the period of time since user request hits the server to session end.
Data stored in session would only be available for that sesion.
**Note by closing Browser at client side dosen't mean that session is ended.
Session gets end when there is no user activity
since last hit by the user to server and default time set for session to end.
2. How to maintain Session?
Ans. To store session data ASP.net technology comes with inproc and out proc model
in Proc: session data gets stored inside same process of web application. During recycling of web application web application
would loose all users session.
out proc: Session data can be stored out of the process using ASP State server or MS SQL server.
Application will get benifit of multiple worker process and those processes will use shared session.
You need to mark classess whose objects participate into session as serializable attribute. as your objects are crossing the boundaries of process.
3. What is View state ?
Ans. View state is hidden control which holds the Values of Controls during page Post back. Those values are specific to Page only.
Can't persist across the application or session.
4. What is Application ?
Ans. Application object: Data stored using these type of object can be conumed by entire web.