Posts

Showing posts from November, 2011

view state difference session state

Session state  is the feature of ASP.NET based web applications using which values of a variable may be persisted and then posted to another page. Viewstate  property of a page or a control, or a viewstate object for a variable value, may also be created to persist its value across a postback. However, the viewstate value are for page level  , i.e. they cannot be posted across to another page. Session State is useful for storing values that must be persisted across multiple pages by the same user. ViewState is useful for storing serializable data that must be persisisted across PostBacks by a single page. If you use Session State, the value you insert will remain in memory until (1) The Session times out, or (2) Your code removes it. If you use ViewState, the value you insert will remain in ViewState until the user requests a different page. ViewState stores data betwen PostBacks by putting it into a hidden form field on the client HTML doc. when the doc is Posted Back, the values are

viewstate : statemanagement

Client side State management Options: ASP.NET provides various client side state management options like Cookies, QueryStrings (URL), Hidden fields, View State and Control state (ASP.NET 2.0). Let's discuss each of client side state management options. Bandwidth should be considered while implementing client side state management options because they involve in each roundtrip to server. Example: Cookies are exchanged between client and server for each page request. View State: View State can be used to store state information for a single user. View State is a built in feature in web controls to persist data between page post backs. You can set View State on/off for each control using EnableViewState  property. By default,  EnableViewState  property will be set to true. View state mechanism poses performance overhead. View state information of all the controls on the page will be submitted to server on each post back. To reduce performance penalty, disable View State for