You are on page 1of 5

State Engine (View State)

Name=Abdirahman Hassan Hersi


Not All Controls Rely on View State

 You have to understand that not all controls rely on View State all the time.
 These controls include Textbox, Checkbox, Radio Button controls.
 They are able to maintain their values,
because they are rendered as standard HTML form controls in the browser.
Cont.…

 For example, a Textbox server control ends up like this in the browser :
• <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="BcGwjGX6qrT4KlpvRF1JNGUWC2ZaRLRCJxHy1FihuNWQbiU8PGQSmxqw
ZvDjLLtA3XSBuGmsUSrL9IdRhB1vNQ33osbjd3q2KjRAUq1JZMw=" />
A Note about View State and Performance

Because the View State engine adds a considerable amount of information to the page, it’s
often a good idea to turn it off when you don’t need it.
This way, you can minimize the size of the hidden __VIEWSTATE field, which means the
page becomes smaller and thus loads faster in the browser.
Note that when you turn off View State you still see the hidden __VIEWSTATE field
because Control State uses the same field to store its data.
Cont.

<%@ Page Language="VB" AutoEventWireup="False" CodeFile="State.aspx.vb"


Inherits="Demos _ State" EnableViewState="False" %>

You might also like