How is Viewstate works?
Viewstate allows state of the objects to be stored in hidden fields,viewstate is transported to client and back to the server between diffrent postbacks.Providing greater security that developer implementing hidden fields.
Here's how it's done. When the WebForm's HTML output is streamed to the browser, the hidden "__VIEWSTATE" field is added to the form. When the form is posted back to the server, the Request.Form Collection (same as ASP) contains the values of the posted form. The Server Control reads the form POST data, extracts the values, and updates (rewrites) the ViewState value to be sent back to the client. At the same time, the Server Control adds the appropriate HTML to the HTML object text to "set" it in it's proper (remembered) state, that is, the state the form field was in when the form was posted. In essence, ASP.Net is doing the same thing that ASP does, although you don't have to write all that code to make it so.