Microsoft ASP.NET Futures (July 2007): Managing History

This sample shows:

  1. The History control and its OnNavigate event.

  2. How to use the History control to set a history point.

Example 1: A server-based UpdatePanel control with history management

In this example, three buttons outside the UpdatePanel control can trigger an asynchronous postback. You can see the results of the update through the date and time that renders in the UpdatePanel control. There is also a value in the UpdatePanel control that indicates which button triggered the refresh.

When you press a button, the Click event handler for the button uses server code to store data and uses the data as a history point for the History control. If you click the browser's Back button, you will see the state that the control was in after the most recent refresh of the UpdatePanel control.

To see the effect of this logic, do the following.

  1. Press 1. See the panel refresh. Note that there is a short delay in the request.
  2. Press 3. See the panel refresh.
  3. Press 2. See the panel refresh.
  4. Press the browser's Back button. Note that the panel is refreshed with previous data, but the date and time are updated to current values.
Date and Time: 7:52:53 AM
Page's refresh state: