Put a textbox, a checkbox and a button on a website.
Set the “EnableViewState” property of textbox and checkbox to false.
Write something into textbox and check the checkbox.
Click the button.
Why is the textbox still written and the checkbox checked after response?
Some things aren’t totally dependent on ViewState. In the controls you listed, those values are available in the POST sent to the server, so they’re gotten out of there and the controls restore their state that way.
Other things, like the text in a
<asp:Label>for instance aren’t sent back in any way, and they’ll lose their data without ViewState. The same is true for other properties, like the styling of the textbox, etc…only it’svaluewill be restored, because that’s all that’s sent back and as a result, all it’s coded to grab and restore. If you were to say make it red, that would be lost on postback.As a general rule, what a control can restore strictly from posted data will be restored on postback, everything else is lost.