I have this snippet of code in my asp.net application
linkBack.NavigateUrl = "#";
linkBack.Attributes["onclick"] = "if (BrowserDetect.browser == 'Explorer') {history.go(-1);} else if (BrowserDetect.browser == 'Chrome') {history.go(-1);return false;}";
BrowserDetect is a JS library that tells me what browser I’m using. Coming back to the point, when I click the back links in Chrome, it takes me one level back in history, exactly as expected. IE takes me one step back, and on the next click, takes me right back to where I was, and subsequent clicks ensure I’m going back and forth between the same two pages. Can someone explain to me what’s going on and how I can fix this?
Because you are doing something different for IE and Chrome? You need to return false from the onclick no matter what. Otherwise the link (#) will be followed