The first thing you should know before I continue is the definition of ViewState:
View state refers to the page-level state management mechanism, utilized by the HTML pages emitted by ASP.NET applications to maintain the state of the web form controls and widgets. The state of the controls is encoded and sent to the server at every form submission in a hidden field known as __VIEWSTATE. The server sends back the variable so that when the page is re-rendered, the controls render at their last state. At the server side, the application may change the ViewState, if the processing requires a change of state of any control. The states of individual controls are decoded at the server, and are available for use in ASP.NET pages using the ViewState collection.
When you’re developing an ASP.NET Web-Forms application and the performance is a consideration, you can disable the ViewState in some of your pages that you don’t want to make use of. Disabling ViewState will affect the page’s HTML source code a lot and removes a lot of useless codes from your page as you can see in the picture below:
A website that disabled the ViewState:
Another website that let the ViewState being enabled:
You can see the difference between two pictures above. So disabling the ViewState is something necessary if you don’t want to use it.
But unfortunately, some of the controls in ASP.NET such as RadioButtonList need to use the ViewState under any circumstances! So you CANNOT disable the ViewState if you need to use these kinds of controls.
I think is an ASP.NET bug so I reported is to the Microsoft. I believe, about 70%-80% of ASP.NET developers don’t want to use the ViewState at least in some of their pages.
0c0ddbc0-0b30-47ff-a2ca-b65a02a7c7b7|0|.0