Form postbacks not in viewstate?

  • Thread starter Thread starter foldface
  • Start date Start date
F

foldface

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
 
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
 
"> I have discussed some of this from TextBox control's standpoint. Maybe it

yep, thats what I wanted, thanks. I knew normal html posted back info
but the mechanism for placing the posted back info back into the control
is within the control itself, not within some obscure bit of the .Net
architecture.
My confusion was because theres the .Net case, the normal html case, and
the case where you don't have a <form> tag around html, i.e. noddy test
cases and trying to work out what happens in each case and why.
 
Back
Top