Re: Form postbacks not in viewstate?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Patrice (nobody_at_nowhere.com)
Date: 05/13/04


Date: Thu, 13 May 2004 11:33:13 +0200

1) This is not an ASP.NET feature. When you press a submit button, the
browser sends a HTTP request to the server. This request contains the value
of all non disabled, named fields that are in your form.
2) The viewstate is an hidden field (as such it is posted by the browser
when the submit button is hit allowing the server to read the viewstate).

ASP.NET is a clever hack but just uses client side what was available
previously (HTML, HTTP).

Patrice

<foldface@yahoo.co.uk> a écrit dans le message de
news:acb840c8.0405130041.41d228b7@posting.google.com...
> Hi
> I have only just become aware that form values posted to the server
don't
> need to be preserved in viewstate because asp.net preserves them anyway
> separately from this.
> 2 questions
> (1) What is the mechanism that preserves them? (Purely for academic
interest)
> (2) I have a property on a control that is added to the viewstate. With
> trace on and some code that shows the contents of the viewstate I see
> that information both in the viewstate and in the "Form Collection"
section
> of the page trace. Is it in both or am I being mislead?
> NB My understanding of the "Form Collection" section is that it shows
all
> the values posted back to the server and viewstate is just one of those
values.
>
> Ta
> F



Relevant Pages

  • Re: the most cost effective way to persist page level objects in server
    ... If you do not like to send it back to the browser look up the link Mark provided about keeping ViewState on the server. ... Ocz I can use view state, but it is persisted though client, not in server ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Textbox retains value when EnableViewState = false
    ... You have mixed up two concepts: ViewState and the value of a field posted ... the browser always sends the field values to the server. ... why does the asp.net textbox retain the text value. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Dealing with the Back button
    ... > that is clicked to cause a postback. ... >>The page lives in the Browser, not on the Server. ... If the page, form and controls are set to use viewstate, then after ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: request.setAttribute(...) versus session.setAttribute(...)
    ... Browser makes HTTP request for document associated with the link's URL ... Server prepares and sends a response, ...
    (comp.lang.java.programmer)
  • Re: Dealing with the Back button
    ... >That page returns the form's values when you hit the back button. ... >> server comes back with an error. ... The site did not maintain your ViewState. ... >> because ASP .NET maintains your ViewState. ...
    (microsoft.public.dotnet.framework.aspnet)