Margaret Rouse is an award-winning technical writer and teacher known for her ability to explain complex technical subjects simply to a non-technical, business audience. Over…
View state is the page-level state management technique used in the ASP.NET page framework to retain the value of controls and page between round trips. Data objects such as hash tables, strings, array objects, array list objects, Boolean values and custom-type converters can be stored in view state. View state is ideally used when the data to be preserved is relatively small and the data need not be secured.
With the page load, view state is contained in a structure, so is easily available. The values contained in view state cannot be transmitted between pages. By default, the view state is switched on and regardless of whether used during a postback, it serializes the information in every control found on the page. To disable the view state for a single control, the EnableViewState property needs to be set as false. The attribute EnableViewStateMac is provided to detect any corruption attempt or technique on the view state. The mean features of view state are to store the values of control properties and pages found in the concerned page, without the help of a session, preserve the value of the control after the postback operation and to create a custom view state provider for storing view state information in a database.
View state is easy to implement and does not require any server resources. It also has enhanced security features and can be compressed or encoded and can contribute to Unicode implementation.
However there are a few disadvantages with view state. For large amounts of data, the performance is not optimal, as large values could potentially cause view state to be slow. View state can only store values for same page only. It also has security risks and requires extra coding to provide security to the information.
Techopedia’s editorial policy is centered on delivering thoroughly researched, accurate, and unbiased content. We uphold strict sourcing standards, and each page undergoes diligent review by our team of top technology experts and seasoned editors. This process ensures the integrity, relevance, and value of our content for our readers.
Margaret is an award-winning technical writer and teacher known for her ability to explain complex technical subjects to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles by the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret's idea of a fun day is helping IT and business professionals learn to speak each other’s highly specialized languages.
What is Pascal Case Pascal case, or PascalCase, is a variable naming convention in programming in which the first letter...
Vangie BealTechnology Expert
What is a Programming Hook? A programming hook is a feature that allows developers to insert custom code into specific...
Marshall GunnellIT & Cybersecurity Expert
What Does Julia Programming Language Mean? Julia is an open source high-level, high-performance dynamic programming language designed at MIT for...
Margaret RouseTechnology Expert
Trending NewsLatest GuidesReviewsTerm of the Day