Well, this very common and a very valid question.
I published one article,
Beginner's Guide To View State [
^] few years back, and in the discussion forum I have asked the same question.
A silly question about viewstate.!!!!! Pin[
^] You can check out my answer there.
Here is the details.
For the answer, first of all you need to know what actually happened during
ASP.NET Page life cycle
and
ViewState
.
In the ASP.Net page life cycle, two events related with View State.
1. Load View State :
Where view state data is loading for the control and which happened before Page_Load.
2. Save View State :
Where control data store in a hidden field before the Page_Render.
Now, If you disable the
ViewState
for the control it should store the view state data but, you are saying in
Textbox
, after you disabled the view state , control holds the data after
postback
,
Here is the Trick,
There is another event fired during Page Life Cycle, which is, Load PostBack Data Smile | :)
ASP.NET controls which implement
IPostBackEventHandler
will load its value from the appropriate
postback
data.
This value is not read from view state but from Postback From and this is true for those control which implements the
IPostBackEventHandler
and
TextBox
is one such control Wink | ;)
One of my friend Brij, has a nice article on this
Why textbox persists data during postback even if View State set to off[
^]
Hope this clears your doubts and This will helps you.