How is Viewstate works?
By in ASP.NET on Jul 26 2006
  • paddu paddu
    Sep, 2008 11

    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.

    • 0
  • Jul, 2006 26

    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.

    How ViewState Works

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS