What are different ways to maintain state
Http protocols are by default stateless. but we can maintain state by the following methods
on server side
1) session objects
2) application objects
on client side
3) hidden fields
What are benefits and limitation of using hidden fields
1) they are stored at the client side which will doesn’t require any server resource
2) it is supported on all browsers
3) they are very easy to use
1) we should not store sensitive information on hidden fields because they can be tampered
2) since they are stored on client side page size will be increased. this may cause slow page loading
3) we cannot store complex objects on a hidden field
What is viewstate
Http protocol is by default stateless. asp.net uses viewstate to display the submitted values after a post back which was a difficult task in classic asp. a viewstate is an encrypted string stored on the client side. large viewstate can affect page performance
What are benefits and limitation of using viewstate
they are stored on a hidden field at client side. no server resources are required to store viewstate
almost all browsers support hidden fields so cross browser compatibility
very easy to implement. no coding is required to restore the values after postback
large viewstate will increase the page size. this may affect page response time.
even though they are hashed, viewstate can be tampered. this can create a potential security issue.
viewstates are by default available within the same page itself.
What are benefits and limitations of using hidden frames
we can access data stored on different hidden frames
more than one data field can be cached in a hidden frame
not all browsers support hidden frames
hidden frame data can be tampered. this can create a potential security issue.
What are benefits and limitations of using cookies
cookies are stored at the client side, so no server resources are required.
persistent cookies will be alive even after the user closes the browser.
cookies can be disabled at the browser.
cookies can be tampered. this can create a potential security issue.
large information cannot be stored on cookies since they have a size limit