What are benefits and Limitation of using Viewstate for state management
The benefits of using Viewstate are as follows:-
1) There is no server resources required because state is in a structure in the page code.
3) The States are retained automatically.
4) The values in view state are hashed, encoded, and compressed, & hence, representing a higher state of security than the hidden fields.
5) The View state is good for caching data in the Web frame configurations as the data is cached on the client.
The limitations of using Viewstate are as follows:-
1) The Page loading and posting performance reduces when large values are stored as view state is stored in the page.
2) Although view state stores data in the hashed format, it can still be tampered as it is stored in a hidden field on the page. The information in the hidden field can be seen if the page output source is viewed directly, creating a potential security risk.