General POSTBACK question

  • Thread starter Thread starter Tom Edelbrok
  • Start date Start date
T

Tom Edelbrok

I'm reading the section "Postbacks and Round Trips" in the Visual Studio
2005 Help (I use VB.NET). Amongst other things, it says that as a result of
a postback "On the Web server, the page runs again. The information that the
user typed or selected is available to the page."

I can set this up in a test project and see that it occurs ... ie: my text
boxes retain their data (ie: "Hello world") even when a postback occurs on
the same or another server control.

If as a result of a postback the web page gets re-rendered at the server,
then how does the text in my textbox (or data in any other sort of server
control) get maintained? I would have thought that if the web-page gets
rebuilt from scratch, any data in controls would be lost.

Can someone explain how this works?

Thanks,

Tom Edelbrok
 
When you click a button that is markded as runat=server it causes a
http postback passing the state of all controls back to the server.

The same occurs when you place a normal html button with a type
attribute of 'submit' within a form on a standard html page.
 
By design fields values are posted to the server. The page can then get
those values to populate the controls...
 
Back
Top