How Do I: Use the ASP.NET AJAX History Control?

One problem faced by a typical AJAX application is that a partial page update is not added to the history of the Web browser. This means that the browser’s Back button does not move back one AJAX step, but moves back one entire document, which is unlikely to be what the user expects. The ASP.NET AJAX History control allows the developer to insert history points so that the user may click the browser’s Back and Forward buttons to move between AJAX steps.

Presented by Scott Golightly

Duration: 8 minutes, 59 seconds

Date: 1 June 2007

Watch the video   |   Download the video   |   Get VB code  or  C# code

Video downloads: WMV | Zune | iPod | PSP | MPEG-4 | 3GP

Audio downloads: AAC | WMA | MPEG-4 | MPEG-3 | MPEG-2

Comments : 4

Leave a Comment

HomerJ : On April 14, 2008 5:41 PM said:

at the end of the video, the initial state isnt restored (in the url there is just a simple '#' attached, pageindex just goes back to 2).

how do i recover that?

cv_vikram : On August 07, 2008 8:05 AM said:

Good tutorial..thanks

jamest85 : On August 15, 2008 2:57 PM said:

I am sorry, but every time I watch your video, I need go to have a cup of coffee first. Your voice makes me sleep.

Good subject though.

jamest85 : On August 15, 2008 5:30 PM said:

The Dim startPage As Int32 = 1, should change to: Int32 = 0.

Otherwise, the "Back" button can't bring you to the first page.

Protected Sub History1_Navigate(ByVal sender As Object, ByVal args As Microsoft.Web.Preview.UI.Controls.HistoryEventArgs) Handles History1.Navigate

       Dim startPage As Int32 = 0  ' change 0 to 1, (James)

       If args.State.ContainsKey("StartPage") Then

           startPage = CInt(args.State("StartPage"))

       End If

       GridView1.PageIndex = startPage

   End Sub

Leave a Comment

You must be logged in to leave a comment. Click here to log in.

Page view counter
Microsoft Communities