Posted on: 9/27/2014 7:36:51 PM | Views : 425

Hi; I'm developing a web app in ASP.NET that loads controls dynamically on a page (depending upon user responses). Handling the back button has been giving me fits. Apparently, there is no handler for that. (If I'm wrong about that, then PLEASE correct me.) What I want to do is to trigger a postback on the back button. (This must be done. There are no alternatives.) I'm trying to detect the "back button state" to accomplish this. The first thing I tried was to keep a running count of request/response cycles and comparing it to window.history.length. If the two are different, then it might be assumed that the back button had been clicked. That didn't work. On the first back button click, both counts increased, remaining equal. My next idea was to write Javascript code to a label that will set a boolean to true if a postback has occurred.
Go to the complete details ...