how to session variable
-
hi i want to know how to use session variable in asp.net2005 and why it is used. and while doing coding at which place this should be written. thanks
Session variables allow you to store information between post backs. The web is stateless, meaning that it doesnt know what it sent you what you are doing or anything between server hits, so to maintain this you can use session variables/cookies/etc... The session variables can be set simply by coding
Session("VariableName") = Value
and then can be retrieved by codingValue = Session("VariableName")
. The session is maintained by a SessionID that is created at the first request and is stored as a session cookie in the user's browser in most cases.
Cleako
-
hi i want to know how to use session variable in asp.net2005 and why it is used. and while doing coding at which place this should be written. thanks
As cleako has described session mentain user information. it can be stored at client side or server side both. At client side, it is stored in cookies and if cookies are disabled then automatically it goes to server. You can keep your session data in database also which is most effective. I hope, this information will help you a bit.