Saturday, March 24, 2012

UpdatePanel and back button

Hi,

I have an asp.net page with an UpdatePanel on it that has a trigger on an image button. The image button alters the update panel to a slightly different state. I have an issue that happens if the user interacts with the update panel, then navigates away from the page and finally returns to the page with the back button on the browser. At this point the page is rendered as it originally appeared (before the update panel was interacted with, and I'm OK with that), but if the user now clicks the image button the update panel does not get processed.

The page load even fires but the image button's on click even doesn't fire. I assume this is because asp.net has figured out that the request is invalid or expired or whatever. My problem is detecting this condition and handling it.

Does anybody have any suggestions?


Hi!,

Have a look at the new History server control found in the ASP.NET Futures (May 2007) package: http://quickstarts.asp.net/Futures/ajax/doc/history.aspx

You need to install the package, but it may help in your situation,

Cheers,



Thanks for the reply Rasetti.

Yes, I saw the history server control however it didn't seem to apply to my condition. I am not trying to save the update panel's state in the history. I am fine with it reverting to its original state if the user presses the back button in the browser. My issue is that once the user does that and tries to click on the update panel's image button trigger, the update panel's on click event does not fire so the update panel gets rendered "empty". I have traced this through and the page load event fires however asp.net must be detecting that the request is not valid in some way and never fires the on click event for the image button.


No comments:

Post a Comment