After the Init() and before the Page_Load(), or OnLoad() for a control.
Item stored in ViewState exist for the life of the current page. This includes postbacks. Viewstate become nothing once it redirects or transfer to another page.
There is no limit. You can have any number of ViewState object on single aspx page. However more Viewstate objects, more slowly it loads.
Enable ViewState turns on the automatic state management feature that enables server controls to re-populate their values on a round trip without requiring you to write any code. This feature is not free however, since the state of a control is passed to and from the server in a hidden form field. You should be aware of when ViewState is helping you and when it is not. For example, if you are binding a control to data on every round trip (as in the datagrid example in tip #4), then you do not need the control to maintain it’s view state, since you will wipe out any re-populated data in any case. ViewState is enabled for all server controls by default. To disable it, set the EnableViewState property of the control to false.
1)Performance can be reduced. becuse the viewstate is stored in the page itself, storing large values can cause the page to slowdown.It can carry only up to 10 KB of data very easily without causing any degraded perfomance.
2) As view state is stored in a hidden field on the page although it stores data in a hashed base64 encoded format, it can be tampered.
1) No server resources are required
2) simple Implementation
3) Automatic retention of page & view state
ViewState persist the values of controls of particular page in the client when post back operation done. When user requests another page previous page data no longer available.
SessionState persist the data of particular user in the server. This data available till user close the browser or session time completes.
It’s a Page class method allows developers to store ASP.NET Page Viewstate on server side instead of storing in client side hidden control