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

Please install Silverlight or click download to watch video locally.

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: 21 June 2007

Watch    Video   |   Download    Video   |   VB Code    C# Code

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

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

Comments : 14

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

Karina Northen : On September 11, 2008 4:27 AM said:

Haw to get the History server control into my AJAX-style application if it’s not appear in tool box?

I find that ‘an inherent problem with AJAX-style applications is browser navigation. Because an AJAX-style page can interact with the server by using asynchronous postbacks, users can perform many tasks without leaving the page. However, if users click the browser's Back button, by default the browser does not return to a previous state of the page (for example, the state before the most recent asynchronous postback). Instead, the browser unloads the page entirely and returns to the page that was displayed before your page was started. Very frequently, this is not what the user intended.

You can manage history (Back and Forward button navigation) to provide a more logical and natural navigation model in your Web application. As the page developer, you control the state that is required to recreate the page. You can manage history navigation in both server and client code.’

But what to do if  the History server control is not appear in tool box?

Thank you for help

karina.northen@talktalk.net

firelinemx : On February 26, 2009 4:50 PM said:

what about bookmarking? if i close the window and bookmark the grid at page 8 and open it once again, will .aspx show me a grid at page 8?

does it handle bookmarking? or need additional controls.

pcgroup : On April 16, 2009 7:19 PM said:

Where can I find this history control?

Does anyone know?

Thank you

haithemara : On May 07, 2009 11:23 AM said:

Good tutorial.

Is there a way to i disable the back navigation button in the browser and only allow the next button to be able.

Thank you.

Monir75 : On May 22, 2009 8:05 PM said:

Thank you for your advice, jamest85. I already fell sleep twice during this short 9 minutes video tutorial.

Jeison : On June 06, 2009 9:47 AM said:

Nice voice :P

Nuri : On June 29, 2009 6:49 AM said:

This video is sooo old...

MdV : On June 29, 2009 10:29 AM said:

I'm running Visual Studio 2008 with .NET 3.5 SP1 and the AjaxControlToolkit version 3.0.30512.17815, but I don't seem to have this History Control in my toolbox.

Does anyone know where can I find it?

shebl777 : On July 14, 2009 7:49 AM said:

firs, this is a good video,but you must drink 2 cup of coffe before starting to explain..

second,the history control, you will find it in VS9 Sp1.

sluyso : On August 25, 2009 10:36 PM said:

Nuri, I garee: this video is sooooo old.

Better, look here:

http://dotnetslackers.com/articles/aspnet/AFirstLookAtASPNETExtensions35HistoryPoints.aspx

Leave a Comment

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

Microsoft Communities