Postbacks and callbacks

The life cycle of a Web forms page begins when the browser presents a form to the user and the user interacts with the form. In previous versions of ASP.NET, any action that required processing that interacted with server components had to post the form back to the server, where the processing occurred before the form was returned to the browser. This is called a round trip.

To improve performance, round trips to the server should be avoided when possible. Performing tasks such as user input validation or sorting in JavaScript, VBScript, or another scripting language on the client can help minimize round trips, as can restricting the use of code that causes a round trip to events that require a definite user action, such as a mouse click.

A major feature introduced in ASP.NET 2.0 is the script callback mechanism. This provides a way to execute server-side code without posting and refreshing the current page. A rendered page can make a background callback to the server, send input data to the relevant page, and receive a response. The response string can then be processed by the client appropriately, often manipulating the rendered page content through the Dynamic HTML (DHTML) object model and a callback JavaScript function embedded in the page.