Tips on reducing View State Size: As we know that total size of ViewState can be 135KB (On date of writing this article), There may be chances that you will hit maximum allowed limit or improve performance of Visualforce page by reducing Viewstate size:
Declare variables as Transient if possible.
Declare variable as Static, as it is not saved in View State.
If you want to manage your own state, instead of using <apex:form> use HTML <form> tag instead.
Recreate state instead of saving in Viewstate. Means if you can use SOQL instead of saving in some object or List, use it.
You can also use Web service call, Ajax Remoting to recreate state instead of saving in Object.
Hi @Nikhil N 8
Here are some tips to avoid "View State" error
Tips on reducing View State Size:
As we know that total size of ViewState can be 135KB (On date of writing this article), There may be chances that you will hit maximum allowed limit or improve performance of Visualforce page by reducing Viewstate size:
please let me know if it helps
Regards
Prateek Bansal