Even I disable the ViewState property, I still see the hidden field _VIEWSTATE

  • Thread starter Thread starter Umut Tezduyar
  • Start date Start date
U

Umut Tezduyar

I want to get rid of the hidden field _VIEWSTATE.

I tried these:

I tried to disable ViewState property.
I tried to override Page's RegisterHiddenField method.
I tried to override Page's SavePageStateToPersistenceMedium.

None of them worked.

Any suggestions?
 
Hi,

overriding SavePageStateToPersistenceMedium (and then equally
LoadPageStateFromPersistenceMedium) is the solution in ASP.NET 1.x. With
ASP.NET 2.0, you could just provide your own PageStatePersister class to
override the behaviour (or use the built.in SessionPageStatePersister class)

This article also gives some insight:
http://aspalliance.com/472
 
You will *still* have a minimal ViewState property,
representing the page itself, even if you turn off the view state
on each and every control and even if you disable it completely.

See :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspnet/html/asp11222001.asp
and
http://www.aspnetresources.com/articles/ViewState.aspx




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 
The _VIEWSTATE hidden field will always be there for an ASP.NET page, but if
you've diabled viewstate then its contents will be tiny and mostly empty,
only filled with minimal data that ASP.NET requires to function properly.
 
Even on this case, __VIEWSTATE still exists as a hidden field...
You should not care about it...
 
Back
Top