Last post Mar 31, 2011 06:25 AM by castlehills
Mar 30, 2011 01:12 AM|ogsim07|LINK
can anyone tell me about enableviewstate in simple words. i have read documents but its not understand to e.
Mar 30, 2011 03:20 AM|Dave Sussman|LINK
ViewState is how ASP.NET retains the state of controls from one page post to another. Normally HTML and HTTP don't do this, so you entered text into a text box and clicked a button to post those values to the server, when the page was redisplayed, the text
box would be empty. ViewState works be encoding the names and values of form fields and storing them as a single string in a hidden field. The advantage is that you get the state retained, so don't have to re-populate the fields, but the disadvantage is that
for every field, the size of the view state increases, and this view state is sent back and forwards with every request.
EnableViewState allows you to turn off view state for the page, so ASP.NET doesn't do this encoding process. Most of the controls will work without it and you'll still retain the state, but you'll have a much smaller page.
Mar 31, 2011 06:25 AM|castlehills|LINK
EnableViewState is a state flag to turn the viewstate on or off. You can set this flag to true globally and in individual pages you can set to false in asp.net 4.0 or visa versa.
Eventhough this flag is set to false, the aspx generated pages will have a little bit of VIEWSTATE information.