hi,
what is mean by session and give me simple example for session.
Thanks & Regards,
gokilavasan
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Mar 27, 2012, 8:32 AM
Please refer the below links
http://www.c-sharpcorner.com/uploadfile/rekhasingh1610/session-object/default.aspx
http://www.c-sharpcorner.com/UploadFile/ganesh.nataraj/ASPdotNETSessionState09212005235624PM/ASPdotNETSessionState.aspx
http://www.c-sharpcorner.com/UploadFile/051e29/session-and-application-in-Asp-Net/
Thanks
SenthilkumarPosted Mar 27, 2012, 10:19 AM
Session is server state mechanism and it is used to store the data in the memory. It is persisted across the post backs and it can be used to transfer between the pages. It is bit costly in terms of usage, because it stores data as object in the serialized format. So it needs serialize and deserialize every time whenever we store and retrieves.
The session data can be shared only for the current user. It can be shared across the pages for the current logged session. It is very easy to use.
Session["Key"] = value;
It has the key and value combination. The value can be retrieved and rewritten using the session key. The session can be abondan and killed by using key.
There are three session states.
1) InProc - Processor memory(IIS)
2) OutProc - state server
2) SqlServer - Session data will be stored in the sql server database
Drawbacks:
-----------
- Increase page pay load
- Additional overhead while serialize and deserialize
- Increase memory allocations to the server
- Microsoft suggest to use the control state rather than view state.
For more Info:
http://msdn.microsoft.com/en-us/library/ms972429.aspx