Thread Rating70.0%Rate this ThreadDouble click on boxes to rate this thread
Client side state management in ASP.Net
Client side state management
In this type page information is stored on the client side. There are different ways to maintain state on client side
1. View state: It is a in built structure for maintaining the state of a page. Its purpose is to keep the state of controls during subsequent post backs by the same user. It indicates the state of an object at that particular instant of time. It is maintained using hidden fields.
a) As it is a client side technique it does not require server resources
b) It is a in built structure
c) It is little secured as the values in view state are hashed, compressed and encoded
a) As view state is stored in the page itself, if we store more information in view state it affects the performance of the page
b) As view state is stored in the page itself we can view its contents when we view the source code.
2. HiddenFields: This is used to store page specific information in hidden fields.
This used to store values in html form with out displaying it on the browser.
We can use these for the page which post backs to itself or to another page.
a) As it is a client side technique it does not require server resources.
b) Most Browsers support this technique
a) As Hidden Fields is stored in the page itself, if we store more information in
Hidden fields it affects page performance
b) Security is less as users can view the information in hidden fields when they
Open the source code.
3. Cookies: A cookie is a file stored on users computer containing information Specific one site. Values stored in a cookie are sent to the same server with every page request through browser. Means they are posted back and forth on every request. Generally frequently changing information will be kept in a cookie. Default life time of a cookie on user s machine is 100000 minutes.
a) It does not require server resources.
b) It is very simple to implement
c) Cookie can expire when browser session ends or it can stay permanently till we apply some expiration rules.
a) Security is less as users can manipulate cookies on their machines.
b) Most Browsers allows only cookie with a max size of 4096 bytes
c) As there is security threat some users may disable their machines capability of receiving cookies thus reducing its functionality.
4. Query Strings: Query string is the information which we see at the end of the pages Url. Generally it is used to place navigation specific information.
We can√Ę‚.¨‚.Ęt keep sensitive information using query string.
a) It Does not require server resources
b) It is very easy to implement
c) Most Browsers support this feature
a) There is a security risk as it is visible in the browsers address bar.
b) Using query strings we can√Ę‚.¨‚.Ęt place more information.(2083 character limit)
5. Control State: This is used to store custom control data between server trips.
This is used to store small amounts of information of a control between server trips.
By default it is stored in hidden fields on a page.
a) server resources are not required
b) Easy to implement.
c) We can√Ę‚.¨‚.Ęt turn off control state at the page level. So, it is more reliable
a) To use this we need to write code for saving and loading of control state.
In this type state information will be stored on the server side.
Login to post your reply