Recently, I have joined NIIT Technologies Ltd, New Delhi (http://www.niit-tech.com/). It’s well known around the world for its remarkable software services in Travel and Transport domain. It’s been few weeks since I have joined but no project allocated to me yet. So I decided to brush up my skills and drill down in State Management Techniques in ASP.Net. I have planned to cover it all gradually. I have started with ViewState, here are some important points about it.
View state is state management technique at the page level. (between the round-trips on same aspx page.)
Veiw state save the information by serializing it into base64 encoded strings.
View state can be saved in another location such as SQL server database by implementing the cusom PageStatePersister class
You can save the information in ViewState (is a dictonary containing key/values pair) between page round trips.
View state data is first converted in to XML and then encoded using base64 encoding.
View State can store following types of objects:StringsIntegersBoolean valuesArray objectsArrayList objectsHash tablesCustom type converters (see the TypeConverter class for more information)(To store other types of objects class must be compiled with Serializable attribute.)
MaxPageStateFieldLength (page attribute) specifies the amount of maximum data that can be stored in viewstate. The page split viewstate into multiple hidden fields if the data exceed this limit.
Changes to view state can be made until the PreRenderComplete event. It means that once a page is rendered changes to viewstate will not be saved.
More about ViewState
Leave your comment
Remember Me
Post Timeline Calendar with Post
Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.