Below are three important differences between session and viewstate.
|
Session
|
ViewState
|
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 .NET interview question videos
You can also see the following video on IEnumerator VS IEnumerable: -