Below are three important differences between session and viewstate.
| ViewState | Session | |
| Data storage location | Browser Hidden fields | On Server |
| Accessible | In the same page. | Across pages |
| Uses cookies | No(NA) | Yes, If cookies disabled will use URL Query string. |
In case you are new to session and view state please see the following ASP.NET training video on importance of Session and viewstate in ASP.NET: -
You can also Buy our .NET interview question book or you can also see more Dotnet interview questions and answers
You can also see the following video on IEnumerator VS IEnumerable: -
i think the definition of ‘viewstate’ is written under ‘session’ and the details of ‘session’ is written under ‘viewstate’