Gridview in Updatepanel + back button in .Net 2.0


I have a gridview in the updatepanel,now after the data is populated in the grid through async postback,if i hit the back button of the browser the grid returns back to empty.

Anyone has a solution to diable the back button or nothing shoudl happen on the back button click.



According to your description ,I would like to suggest you to check the links below for some articles which describe how to enable Back/Forward-Button Support for ASP.NET AJAX UpdatePanel.

On your ScriptManager, you need to set EnableHistory="true". Then, on the buttons that change from page1 to page 2 (to print page #3), you have to invoke ScriptManager.GetCurrent(Page).AddHistoryPoint("KeyName", value);

This saves the back button history state.

Now you have to override the OnNavigate event of the ScriptManager (or ScriptManagerProxy if your ScriptManager is in a MasterPage). When navigating, you have to restore the user’s previous state manually.

The default behavior of the back button is what you are seeing — it goes to the previous URL loaded in the browser. When you are using UpdatePanels, this URL doesn’t change.

There are a few tutorials about this, here is one:

You can also google against ScriptManager, EnableHistory, AddHistoryPoint, and OnNavigate.

Managing Browser History Using ASP.NET Server Controls

Hi Chetan,

Really Appreciate your reply.

But all these changes holds good for .net 3.5 not for .net 2.0.

Please let me know if any thing is possible to be done in .net 2.0



Leave a Reply