What Is The Advantage Of View State And Disadvantage?

3

3 Answers

Mozhde - Profile
Mozhde - answered
Advantages of Using View State
• It is easy to implement.
• Enhanced security features. The values in view state are hashed, compressed, and encoded for Unicode implementations.
• It retains page and control state for us automatically.
• It does not use server resources since all of the state information is contained within the page itself.
• On ordinary Web Forms pages, their view state is sent by the server as a hidden variable in a form, as part of every response to the client, and is returned to the server by the client as part of a post back. However, to reduce bandwidth demand, ASP.NET does not send a page’s view state to the client. Instead, the view state is saved as part of a user’s session on the server. Where there is a view state, a hidden field that identifies this page’s view state is sent by the server as part of every response to the client, and is returned to the server by the client as part of the next request.

Disadvantages of Using View State
• Page security can be a problem when using View State Performance. The view state is stored in the page itself, so increase the page size

• The view state is stored in a hidden field on the page. Although view state stores data in a hashed format and the View State data is available in the page source and, even though it is encrypted, it can be tampered with and be mutilated.

• Scope is limited to only single page.

• Because the view state for a given page must be kept on the server, if the user uses the Back feature on the browser to go back in the history, it is possible for the current state to be out of synchronization with the current page of the browser
Anonymous Profile
Anonymous answered
Advantages:
- No server resources required
- simple implementation
- automatic retention of page and control state
- Enhanced security features. The values in view state are hashed, compressed, and encoded for Unicode implementations.

Disadvantages:
-Scope is limited to only single page.
-Performance. The view state is stored in the page itself, so increase the page size.
-Security. The view state is stored in a hidden field on the page. Although view state stores data in a hashed format, it can be tampered with.

-Some mobile devices do not allow hidden fields at all. Therefore, view state will not work for those devices.
-It does not restore the values to the controls after a post back operation.
Alishan Samdani Profile
Alishan Samdani answered
View state is a hidden variable used to fill in the space when HTTP protocol is in a stateless position. To get detail on the advantages and disadvantages of View state, please visit the following link.
View state

Answer Question

Anonymous