Session state vs. View state:

In some cases, using view state is not feasible. The alternative for view state is session state. Session state is employed under the following situations:
1. Large amounts of data - View state tends to increase the size of both the HTML page sent to the browser and the size of form posted back. Hence session state is used.
2. Secure data - Though the view state data is encoded and may be encrypted, it is better and secure if no sensitive data is sent to the client. Thus, session state is a more secure option.
3. Problems in serializing of objects into view state - View state is efficient for a small set of data. Other types like DataSet are slower and can generate a very large view state.


Comments

Popular posts from this blog

How do I calculate a MD5 hash from a string?

What is WSDL?