function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sree SalesforceSree Salesforce 

what is view state and why we are using

Best Answer chosen by Sree Salesforce
Michael VerhovskiMichael Verhovski
Visualforce pages that contain a form component also contain an encrypted, hidden form field that encapsulates the view state of the page. This view state is automatically created, and as its name suggests, it holds the state of the page - state that includes the components, field values and controller state.

You could read more about the view state in An Introduction to Visualforce View State (https://developer.salesforce.com/page/An_Introduction_to_Visualforce_View_State)  document 

Please mark my answer as a best solution to your question to help others if it solves your problem

All Answers

Michael VerhovskiMichael Verhovski
Visualforce pages that contain a form component also contain an encrypted, hidden form field that encapsulates the view state of the page. This view state is automatically created, and as its name suggests, it holds the state of the page - state that includes the components, field values and controller state.

You could read more about the view state in An Introduction to Visualforce View State (https://developer.salesforce.com/page/An_Introduction_to_Visualforce_View_State)  document 

Please mark my answer as a best solution to your question to help others if it solves your problem
This was selected as the best answer
Deepak Kumar ShyoranDeepak Kumar Shyoran
View state contains private,public,global variable etc.  You can read more about the view state and how to controll it.As I've wrote a blog on view state which describe best practice to controll the view state to view the current view state of  your page .

Please visit the following link whihc describe you how to reduce view state for a page.
http://forcespider.wordpress.com/2013/10/21/how-to-reduce-the-view-state-of-a-page-in-salesforce/

Please mark my answer as a best solution to your question to help others if it solves your problem
Rajesh PotnuruRajesh Potnuru
Stop spamming with your interview questions
Ankit AroraAnkit Arora
Why don't you google everything up before putting your questions here? Answers to questions like these are easily available on google.