SESSION Variables are stored on the server, can hold any
type of data including references, they are similar to global variables in a
windows application and use HTTP cookies to store a key with which to locate
user's session variables.
VIEWSTATE Variables are stored in the browser (not as
cookies) but in a hidden field in the browser. Also Viewstate can hold only
string data or serializable objects.
Web Applications are natively statesless, means once a web
page renders from server to client, nothing remains on server and the next time
user submits the page you have to create the page again.
Solutions in ASP.NET
ASP.NET provides multiple simple
solutions to this problems like:Solutions in ASP.NET
1- Viewstate
2- Session Variables
3- Application Variables
4- Cache
5- Cookies
https://www.youtube.com/watch?v=TmHILJhJfFo
https://www.youtube.com/watch?v=odxU3L1OB-M