Viewstate is a client side state management technique or method. View state is a temprory storage media to store any value in page level only.
Viewstate is also used to maintain state of server controls like textbox during postbacks of a page.
In view state, you can also store structured data like arraylist, dataset etc.
Lets say there is data table filled with data.
DataTable dt=new Datatable();
//fill dt with data and store it in viewstate to persist its value in page during postbacks.
//store value in view state
//get value from view state
Asked In: Many Interviews |